From owner-freebsd-questions@FreeBSD.ORG Fri Jul 11 08:22:22 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 A87B9106567D for ; Fri, 11 Jul 2008 08:22:22 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: from web57009.mail.re3.yahoo.com (web57009.mail.re3.yahoo.com [66.196.97.113]) by mx1.freebsd.org (Postfix) with SMTP id 4F2558FC16 for ; Fri, 11 Jul 2008 08:22:22 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: (qmail 44971 invoked by uid 60001); 11 Jul 2008 08:22:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=Qq212xjYTJRbj8MhBYrnbtuX83cP5QpfDKdw3udWMlPnnugwr/dJdlyIYRJqLVkitnv0vpG/Ld9cWJK6mpihwLvgvSJlszyijrt0GAAtKch3gCs+6IbzryggTYBeKSh+c7fag0JrTTZRPhHABI0q07IFKbzgEvSIeoz61Rg71y8=; Received: from [220.255.7.243] by web57009.mail.re3.yahoo.com via HTTP; Fri, 11 Jul 2008 01:22:21 PDT X-Mailer: YahooMailWebService/0.7.199 Date: Fri, 11 Jul 2008 01:22:21 -0700 (PDT) From: Unga To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <310032.41745.qm@web57009.mail.re3.yahoo.com> Subject: Library mapping question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: unga888@yahoo.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 08:22:22 -0000 Hi all I have same name libraries in two different locations, eg. /usr/lib/libXXX.so and /usr/local/lib/libXXX.so. They were created using same sources and the same compiler. The app1 is linked with /usr/lib/libXXX.so and app2 is linked with /usr/local/lib/libXXX.so. When app2 is run, the dynamic linker (ld-elf.so.1) finds /usr/lib/libXXX.so first and ends up with following error: undefined reference to `_myxxx' This is not an issue with Linux's dynamic linker but it seems FreeBSD's function look up is very specific. I cannot change the dynamic linker's search path, then app1 fails. How do I get the app2 to refer to /usr/local/lib/libXXX.so? In FreeBSD, is there a way to instruct the dynamic linker (ld-elf.so.1) to continue to search for the same library name in different locations? What are the other possible options? Appreciate your reply. Kind regards Unga