public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* Unresolved reference _imp__pthread_XXXX
@ 2003-05-26 22:29 Ghislain Cottat
  0 siblings, 0 replies; 3+ messages in thread
From: Ghislain Cottat @ 2003-05-26 22:29 UTC (permalink / raw)
  To: pthreads-win32

oops sorry for the fumble ;)

the end of the mail was :

"
...since a dumpbin on libpthreadGC.a gives :

     CD40 __imp__pthread_mutex_init
     CD40 _pthread_mutex_init

(for example)
"

Thanks in advance for your help,

Another thing is that when I tried to compile pthreadGCE, I got the
following error :

In file included from private.c:45:
ptw32_threadStart.c:89: syntax error before `;' token
ptw32_threadStart.c: In function `void ptw32_terminate()':
ptw32_threadStart.c:109: `ptw32_oldTerminate' undeclared (first use this
   function)
ptw32_threadStart.c:109: (Each undeclared identifier is reported only once
for
   each function it appears in.)
ptw32_threadStart.c:109: `set_terminate' undeclared (first use this
function)
ptw32_threadStart.c:112: `terminate' undeclared (first use this function)
ptw32_threadStart.c: In function `unsigned int ptw32_threadStart(void*)':
ptw32_threadStart.c:269: `terminate_handler' undeclared (first use this
   function)
ptw32_threadStart.c:269: parse error before `=' token
ptw32_threadStart.c:272: `term_func' undeclared (first use this function)
make[1]: *** [private.o] Error 1


whereas the README file tells building pthreadGCE with mingw32 is OK !

Good night all,

--
Ghislain Cottat



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unresolved reference _imp__pthread_XXXX
       [not found] <F0E13277A26BD311944600500454CCD0569121@antarctica.intern.net>
@ 2003-05-27  6:41 ` Thomas Pfaff
  0 siblings, 0 replies; 3+ 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] 3+ messages in thread

* Unresolved reference _imp__pthread_XXXX
@ 2003-05-26 22:22 Ghislain Cottat
  0 siblings, 0 replies; 3+ messages in thread
From: Ghislain Cottat @ 2003-05-26 22:22 UTC (permalink / raw)
  To: pthreads-win32

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 :



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-27  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-26 22:29 Unresolved reference _imp__pthread_XXXX Ghislain Cottat
     [not found] <F0E13277A26BD311944600500454CCD0569121@antarctica.intern.net>
2003-05-27  6:41 ` Thomas Pfaff
  -- strict thread matches above, loose matches on Subject: below --
2003-05-26 22:22 Ghislain Cottat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).