From: Sergio N. <sfh...@ho...> - 2015-07-26 22:36:03
|
> The problem is just the same with undefined references to _imp__* while compiling via > ln.exe -s `g++ -print-file-name=libgomp.a`> g++ openmp.cpp -o openmp.exe -static -static-libgcc -static-libstdc++ -fopenmp -L.> Doing this>ln.exe -s `g++ -print-file-name=libgomp.a`>g++ openmp.cpp -o openmp.exe -static-libgcc -static-libstdc++ -fopenmp -L.> gives openmp.exe which is dependent from pthreadGC2.dll. The static library corresponding to pthreadGC2.dll I'm far from an expert here but apparently someone has built either GCC or libgomp (or both) in 'shared' mode and now the OP is banging his/her head against the wall since there is no way the OP could revert this 'shared' mode. To my mind, this issue has nothing to do with pthreads library, but GCC or gomp (or both). Take a look at this: c:/mingw/bin/../lib/gcc/mingw32/4.7.2\libgomp.a(parallel.o):(.text+0x66): undefi ned reference to `_imp__pthread_mutex_lock' c:/mingw/bin/../lib/gcc/mingw32/4.7.2\libgomp.a(parallel.o):(.text+0x86): undefi ned reference to `_imp__pthread_mutex_unlock' c:/mingw/bin/../lib/gcc/mingw32/4.7.2\libgomp.a(parallel.o):(.text+0x14f): undef ined reference to `_imp__pthread_mutex_lock' c:/mingw/bin/../lib/gcc/mingw32/4.7.2\libgomp.a(parallel.o):(.text+0x169): undef ined reference to `_imp__pthread_mutex_unlock' Have fun. |