From owner-freebsd-questions@FreeBSD.ORG Mon Mar 7 01:15:30 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58D5316A4CE for ; Mon, 7 Mar 2005 01:15:30 +0000 (GMT) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id D226D43D39 for ; Mon, 7 Mar 2005 01:15:29 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 0C3815DB2; Sun, 6 Mar 2005 20:15:29 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 61871-06; Sun, 6 Mar 2005 20:15:28 -0500 (EST) Received: from [192.168.1.3] (pool-68-161-53-96.ny325.east.verizon.net [68.161.53.96]) by pi.codefab.com (Postfix) with ESMTP id E9A5A5DA6; Sun, 6 Mar 2005 20:15:27 -0500 (EST) Message-ID: <422BAB2E.9060703@mac.com> Date: Sun, 06 Mar 2005 20:15:26 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jonathon McKitrick 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> In-Reply-To: <20050306215500.GA5571@dogma.freebsd-uk.eu.org> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at codefab.com cc: freebsd-questions@freebsd.org Subject: Re: Which lib for pthreads? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2005 01:15:30 -0000 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