the dll itself resides in mingw/bin on windows the library is in /mingw/lib/gcc/mingw32/(version number)/libgomp.dll.a -fopenmp seems to be enough on most things i tried that could actually use it
I've found '/mingw/lib/gcc/mingw32/(version number)/libgomp.dll.a' and added the absolute path of '....\MinGW\lib\gcc\mingw32\4.4.1\' to the search directories. I've also put '-fopenmp' but I still receive the errors...
Remove the path from search directories and add gomp to the link libraries !
Obvious the above is the right way!!!
I met the same problem: in C::B, compiled a small OpenMP example but got undefined reference to `omp_get_num_threads'
I have manually compiled and linked the example using mingw-gcc, but it is OK.
g++ testOpenMP.cpp -o a.exe -fopenmp
I then manually compiled and linked standalone respectively,
g++ testOpenMP.cpp -c -o testOpenMP.o -fopenmp
g++ testOpenMP.o -o a.exe
the same problem occurred. If linked with -fopenmp, it is OK.
Conclusion: C::B executed the linker to create execute, not with -fopenmp link options. The solution is add
gomp to the link libraries