Unresolved reference _imp__pthread_XXXX

Thomas Pfaff tpfaff@gmx.net
Tue May 27 06:41:00 GMT 2003


Ghislain Cottat wrote:
> Hello,
> 
> Trying to compile a linux project with mingw32 (latests binaries, gcc
> 3.2.3
> and msys 1.0.8, etc.), I could build pthreadGC.dll, as well as all
> tests,
> and run them sucessfully, but when I try to link with my project (the
> build
> process works perfectly with linux), I have undefined reference with
> pthread
> symbols :
> 
> g++     -o cnedra.exe -lstdc++ -lpthreadGC kernel/cnedra-kernel.o
> kernel/cnedra-library.o kernel/cnedra-main.o kernel/cnedra-thread.o
> kernel/cnedra-plugin.o
> 

Try

g++  -o cnedra.exe kernel/cnedra-kernel.o
kernel/cnedra-library.o kernel/cnedra-main.o kernel/cnedra-thread.o
kernel/cnedra-plugin.o -lpthreadGC

The order is important if you link with GNU ld, you must put your libs 
behind the objects. And -lstdc++ is not neccessary if you link with g++.

Thomas



More information about the Pthreads-win32 mailing list