This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unresolved reference _imp__pthread_XXXX


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]