[Solution] Compile C++ with OMP with g++ error

[Solution] Compile C++ with OMP with g++ error

If you are trying to compile C++with g++ and faced some function reference errors like

undefined reference to `omp_get_thread_num'

if you are using this function

omp_get_thread_num()

or any other similar errortry to add this to the compilation options

-fopenmp

even in the compilation command or from the project properties on netbeans

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.