From owner-freebsd-questions@FreeBSD.ORG Mon Mar 7 15:40:03 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 4FA7016A4CE for ; Mon, 7 Mar 2005 15:40:03 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE0A943D5D for ; Mon, 7 Mar 2005 15:40:02 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.1) id j27FcjgJ078508; Mon, 7 Mar 2005 09:38:45 -0600 (CST) (envelope-from dan) Date: Mon, 7 Mar 2005 09:38:45 -0600 From: Dan Nelson To: Jonathon McKitrick Message-ID: <20050307153845.GF2272@dan.emsphone.com> 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> <422BAB2E.9060703@mac.com> <20050307122229.GA36571@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050307122229.GA36571@dogma.freebsd-uk.eu.org> X-OS: FreeBSD 5.3-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.8i 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 15:40:03 -0000 In the last episode (Mar 07), Jonathon McKitrick said: > On Sun, Mar 06, 2005 at 08:15:26PM -0500, Chuck Swiger wrote: > : Um. If you are compiling C++ code into an object file, you ought > : to use c++ and not cc when linking, too. > > I'm using ${CC} in the makefile, and it seems to automagically choose > the correct tool. > > : 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... > > That was the problem. I thought only the library with the thread > calls needed to be linked with pthread. Apparently the app needs it > as well. Ideally not; dynamic shared libraries can list dependencies: $ ldd /usr/lib/libreadline.so /usr/lib/libreadline.so: libncurses.so.5 => /lib/libncurses.so.5 (0x2819a000) I'm pretty sure static libs could do the same at one time, but I can't find any documentation to back that up. -- Dan Nelson dnelson@allantgroup.com