From owner-freebsd-questions@FreeBSD.ORG Wed Mar 26 22:31:16 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81461065670 for ; Wed, 26 Mar 2008 22:31:16 +0000 (UTC) (envelope-from mdh_lists@yahoo.com) Received: from web56815.mail.re3.yahoo.com (web56815.mail.re3.yahoo.com [66.196.97.89]) by mx1.freebsd.org (Postfix) with SMTP id 689FA8FC15 for ; Wed, 26 Mar 2008 22:31:16 +0000 (UTC) (envelope-from mdh_lists@yahoo.com) Received: (qmail 42109 invoked by uid 60001); 26 Mar 2008 22:31:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=wn3WtGkFhaf4bJ6XBU8NPYPhtW2jomCei8PxqOdaiGp9DTFsQGc1dbrVsQcxYI3WQC9JLKpfctq7Uk/fA1t6U2CBxsZd6ldrVmSXF7/aGGztE6GUdD3cB4t/Uq2D4SLkSk8KwzFabXto/1LB0UGBVWFdYB2hTM6LNz8bFkQgO5E=; X-YMail-OSG: mNwIcwwVM1mOYUSYjCLAGTvtjfhvn7K1EYd81A9q8k398h4YzdP8CE_NeaIz7Q3jSYzlBU7gPuzE0hhtDyvxg3bNVnGDpdaYhyMAzr_lqfv2pxqaXGfpxs3IPRjjK4t9TimfKU3d9ISE5Ac- Received: from [71.61.66.195] by web56815.mail.re3.yahoo.com via HTTP; Wed, 26 Mar 2008 15:31:15 PDT Date: Wed, 26 Mar 2008 15:31:15 -0700 (PDT) From: mdh To: stevefranks@ieee.org, User Questions In-Reply-To: <539c60b90803261446h38ee141bjc89f7156c204d58@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <124860.41309.qm@web56815.mail.re3.yahoo.com> Cc: Subject: Re: freebsd equiv of libdl.a (load shared libs) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2008 22:31:16 -0000 --- Steve Franks wrote: > On Wed, Mar 26, 2008 at 2:39 PM, Steve Franks > wrote: > > I am porting a linux app which is looking for > libdl.a (which I > > understand from googling is related to loading of > shared libs). The > > app makes a libusb-based shared lib. FreeBSD > uses shared libs, so I > > assume there is equivalent functionality > somewhere. I also see > > libdl.a in /compat/linux/lib, but I assume if I > link a native FreeBSD > > app against this, fireworks will be the only > result. I further assume > > since I got no error from gcc, that some freebsd > header actally points > > to the exact functions expected in libdl.a, so > they are in there > > somewhere.... > > > > Steve > > > > -- > > Steve Franks, KE7BTE > > Staff Engineer > > La Palma Devices, LLC > > http://www.lapalmadevices.com > > (520) 312-0089 > > > > Looks like changing -ldl to -lc (libc.a) to the link > step in my > makefile did it. No idea why they weren't picking > that up... > > Steve You don't need -lc. C compilers link in libc regardless. You may also want to consider letting it load dynamically at runtime rather than linking the static .a file at compile-time. Chances are what it was looking for was dlopen() and friends, which are in libc on FreeBSD. They are a part of libc on my Linux systems as well though, so not sure why it'd be trying to link against another library, though admittedly I know a lot more about development for FreeBSD than for Linux. - mdh ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ