ubuntu : __errno_location undefined

C

czp.opensource

hi all:
my code is work well on fedora 7 or fedora 8. now i installed
ubuntu, my code can't compile crrectly.
error is __errno_location function is not defined: undefined
reference to `__errno_location()'
but the function is exectly defined in libpthread.a.
nm /usr/lib/libpthread.a | grep errno
U __errno_location
errno.o:
00000051 T __errno_location
00000000 T __h_errno_location
U __errno_location
U __errno_location

why? help please!

Allen
 
C

Chris Gordon-Smith

hi all:
my code is work well on fedora 7 or fedora 8. now i installed
ubuntu, my code can't compile crrectly.
error is __errno_location function is not defined: undefined
reference to `__errno_location()'
but the function is exectly defined in libpthread.a.
nm /usr/lib/libpthread.a | grep errno
U __errno_location
errno.o:
00000051 T __errno_location
00000000 T __h_errno_location
U __errno_location
U __errno_location

why? help please!

Allen
Sounds like a linking problem. Is it something to do with the way you have
specified libraries to be used. Often if you specify library A first and B
later in the list, then if something in B calls something in A, the linker
will not find it. One way to handle this is to repeat the list of
libraries, so that A now appears after B, as well as before it.

Chris Gordon-Smith
www.simsoup.info
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,966
Members
47,515
Latest member
Harvey7327

Latest Threads

Top