* Re: Unresolved reference _imp__pthread_XXXX
[not found] <F0E13277A26BD311944600500454CCD0569121@antarctica.intern.net>
@ 2003-05-27 6:41 ` Thomas Pfaff
2003-05-27 19:56 ` Unresolved reference _imp__pthread_something Ghislain Cottat
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Pfaff @ 2003-05-27 6:41 UTC (permalink / raw)
To: Ghislain Cottat; +Cc: pthreads-win32
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
^ permalink raw reply [flat|nested] 2+ messages in thread