Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Mar 2005 20:15:26 -0500
From:      Chuck Swiger <cswiger@mac.com>
To:        Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Which lib for pthreads?
Message-ID:  <422BAB2E.9060703@mac.com>
In-Reply-To: <20050306215500.GA5571@dogma.freebsd-uk.eu.org>
References:  <20050305183226.GA47472@dogma.freebsd-uk.eu.org> <20050306011827.GE2272@dan.emsphone.com> <20050306213249.GA4624@dogma.freebsd-uk.eu.org> <20050306213955.GA11496@gothmog.gr> <20050306215500.GA5571@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jonathon McKitrick wrote:
> jcm@worker:...cvs/tcontainer/libplugina> make install
> cc -O -pipe -Wall -g -I.. -I../include -shared -fPIC -c plugina.c
> c++  -O -pipe -Wall -g -I.. -I../include -shared -fPIC -c wrapper.cpp
> c++  -O -pipe -Wall -g -I.. -I../include -shared -fPIC -c myclass.cpp
> cc -O -pipe -Wall -g -I.. -I../include -shared -fPIC -c threads.c
> cc -O -pipe -Wall -g -I.. -I../include -shared -fPIC  -pthread -lstdc++ -g
> -Wl,-soname,libplugina.so.0 -o libplugina.so.0.0 plugina.o wrapper.o
> myclass.o threads.o

Um.  If you are compiling C++ code into an object file, you ought to use c++ 
and not cc when linking, too.

> ---> Installing libplugina.so to /home/jcm/lib
> install -m 644 libplugina.so.0.0 /home/jcm/lib
> ln -sf libplugina.so.0.0 /home/jcm/lib/libplugina.so.0
> ln -sf libplugina.so.0 /home/jcm/lib/libplugina.so
> jcm@worker:...cvs/tcontainer/libplugina> app
> /usr/libexec/ld-elf.so.1: /home/jcm/lib/libplugina.so: Undefined symbol
> "pthread_create"
> jcm@worker:...cvs/tcontainer/libplugina> 

Also, you may not have relinked 'app'.  Do an ldd on app and see whether it 
has a dependency on libc_r?  Try relinking app using -pthread against a 
libplugina.so compiled with -pthread...

-- 
-Chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?422BAB2E.9060703>