[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pthread linking issue
From: |
Chris Coleman |
Subject: |
pthread linking issue |
Date: |
Tue, 19 Oct 2004 23:39:25 +0100 |
User-agent: |
Mozilla Thunderbird 0.8 (X11/20040922) |
Hi,
I have a question about the libtool package and automake...
In my configure.in I have AC_PROG_LIBTOOL to set up the necessary bits n
bobs. I also have the macro ACX_PTHREAD to determine which threading
libraries are needed in order to link my app.
However on the final stage of make (and only since I added libtool to
the project) it now fails with the errors below. Now I guess its not
linking with the pthread library for some reason. -pthread is what the
ACX_PTHREAD macro chooses both on solaris and linux, however if I copy
and past the libtool link line at the bottom and change -pthread to
-lpthread the final excecutable compiles with no problem. Any clues as
to why this is, whats the difference and how to solve it?
/bin/sh ../libtool --mode=link c++ -g -O2 -pthread -o zzserver.C
socketexception.o socket.o communicatingsocket.o socketutils.o
tcpsocket.o tcpserversocket.o threadpoolserver.o zz_threadpoolserver.o
main.o
c++ -g -O2 -o zzserver.C socketexception.o socket.o
communicatingsocket.o socketutils.o tcpsocket.o tcpserversocket.o
threadpoolserver.o zz_threadpoolserver.o main.o
threadpoolserver.o(.text+0x2e): In function
`threadpoolserver::threadpoolserver[not-in-charge](int, int, int, int)':
/home/cqc/zzserver/src/threadpoolserver.cpp:19: undefined reference to
`pthread_mutexattr_init'
threadpoolserver.o(.text+0x38):/home/cqc/zzserver/src/threadpoolserver.cpp:21:
undefined reference to `pthread_mutexattr_settype'
threadpoolserver.o(.text+0xae): In function
`threadpoolserver::threadpoolserver[in-charge](int, int, int, int)':
/home/cqc/zzserver/src/threadpoolserver.cpp:19: undefined reference to
`pthread_mutexattr_init'
threadpoolserver.o(.text+0xb8):/home/cqc/zzserver/src/threadpoolserver.cpp:21:
undefined reference to `pthread_mutexattr_settype'
threadpoolserver.o(.text+0x4f3): In function
`threadpoolserver::handle_requests_loop(void*)':
/home/cqc/zzserver/src/threadpoolserver.cpp:297: undefined reference to
`_pthread_cleanup_push'
threadpoolserver.o(.text+0x7a8): In function
`threadpoolserver::delete_handler_thread()':
/home/cqc/zzserver/src/threadpoolserver.cpp:461: undefined reference to
`pthread_cancel'
threadpoolserver.o(.text+0x84c): In function
`threadpoolserver::delete_handler_threads_pool()':
/home/cqc/zzserver/src/threadpoolserver.cpp:492: undefined reference to
`pthread_join'
collect2: ld returned 1 exit status
If anyone can help out then I'd be much appreciated as I have exhausted
just about every keyword combo I can think of in google...
Also, why does it wish to call the final excecutable zzserver.C not
zzserver?
Many thanks for any possible help, and apologies if these are trivial
questions, I'm new to this and learning alot quite fast so hopefully
won't plague you too much ;)
Cheers
Chris
- pthread linking issue,
Chris Coleman <=