This is the mail archive of the
pthreads-win32@sources.redhat.com
mailing list for the pthreas-win32 project.
Unresolved reference _imp__pthread_XXXX
- From: "Ghislain Cottat" <ghislain dot cottat at wanadoo dot fr>
- To: <pthreads-win32 at sources dot redhat dot com>
- Date: Tue, 27 May 2003 00:24:18 +0200
- Subject: Unresolved reference _imp__pthread_XXXX
- Reply-to: "Ghislain Cottat" <ghislain dot cottat at wanadoo dot fr>
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
=>
kernel/cnedra-kernel.o: In function
`ZNSt8_Rb_treeISsSt4pairIKSsP8I_ThreadESt10_Select1stIS4_ESt4lessISsESaIS4_E
ED1Ev':
c:/mingw/include/c++/3.2/bits/stl_tree.h(.text$_ZN8CK_MutexC1Ev+0xf):
undefined reference to `_imp__pthread_mutex_init'
c:/mingw/include/c++/3.2/bits/stl_tree.h(.text$_ZN8CK_MutexD1Ev+0xd):
undefined reference to `_imp__pthread_mutex_destroy'
c:/mingw/include/c++/3.2/bits/stl_tree.h(.text$_ZN8CK_Mutex4LockEv+0xd):
undefined reference to `_imp__pthread_mutex_lock'
c:/mingw/include/c++/3.2/bits/stl_tree.h(.text$_ZN8CK_Mutex6UnlockEv+0xd):
undefined reference to `_imp__pthread_mutex_unlock'
c:/mingw/include/c++/3.2/bits/stl_tree.h(.text$_ZN20CK_ConditionVariableC1Ev
+0xf): undefined reference to `_imp__pthread_cond_init'
c:/mingw/include/c++/3.2/bits/stl_tree.h(.text$_ZN20CK_ConditionVariableD1Ev
+0xd): undefined reference to `_imp__pthread_cond_destroy'
c:/mingw/include/c++/3.2/bits/stl_tree.h(.text$_ZN20CK_ConditionVariable6Sig
nalEv+0xd): undefined reference to `_imp__pthread_cond_signal'
c:/mingw/include/c++/3.2/bits/stl_tree.h(.text$_ZN20CK_ConditionVariable4Wai
tER8CK_Mutex+0x10): undefined reference to `_imp__pthread_cond_wait'
kernel/cnedra-thread.o: In function `ZN9CK_ThreadC2EP8I_KernelRKSs':
d:/incoming/cnedra/kernel/thread.cpp:24: undefined reference to
`_imp__pthread_create'
The only difference between the build command in mingw and the same in linux
is that I had to remove '-rdynamic -ldl' since it is not supported/needed
with mingw, and I somehow understood that it should be harmless.
I know this looks like some silly C/C++ symbols difference, but there is
'extern "C"' is is pthread.h so everything should be fine... Actually the
symbols are OK, there is just an underscore missing I guess, since a dumpbin
on libpthreadGC.a gives :