From owner-freebsd-questions@FreeBSD.ORG Sat Mar 26 23:31:19 2011 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 873FF106566B for ; Sat, 26 Mar 2011 23:31:19 +0000 (UTC) (envelope-from gkeramidas@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 429458FC08 for ; Sat, 26 Mar 2011 23:31:18 +0000 (UTC) Received: by gxk28 with SMTP id 28so953630gxk.13 for ; Sat, 26 Mar 2011 16:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=a0ZRHcn6v2OmswbabknX/QgncOhfNGWE36bEyycYjg8=; b=jerPb1Ga2CvAn2/pScADnOU3Z7UXcHXHIxieCwlbX5+z8BeOhbyLDjreS/zr+No3Qw sQbjMpIVB0wnzwx100SIKJMBAh16sC8GdUBjRVXncoLovoNsEE1XzlmNSEbrFIF0/qSs CuU0KZDMsYRtTvxFCbgWT4kZp19XCn8N3s8zw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=an9lOP3kw1G/2riEG4e/UJJgIMM9ujc0po85+Dsqqt2One9/vhjd72T5pfKurOLA3G HLYnqudQ0uV5UTRp4dp0R21m8PxOKRVP0hQnFeP78cwk+c5EdEcnUWgVUmTvhSB4RFob 4aJGVLpQ31Ro7EwExZFCxwd4899o8Vl/zjUqo= MIME-Version: 1.0 Received: by 10.236.92.9 with SMTP id i9mr3249834yhf.268.1301182278462; Sat, 26 Mar 2011 16:31:18 -0700 (PDT) Sender: gkeramidas@gmail.com Received: by 10.147.181.12 with HTTP; Sat, 26 Mar 2011 16:31:18 -0700 (PDT) In-Reply-To: References: Date: Sun, 27 Mar 2011 00:31:18 +0100 X-Google-Sender-Auth: 5pMe5cNsvXh51VqC0C6oRMkJUs4 Message-ID: From: Giorgos Keramidas To: Jim Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: opening a shared object / failing with Undefined Symbol. 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: Sat, 26 Mar 2011 23:31:19 -0000 On Tue, Mar 22, 2011 at 2:28 PM, Jim wrote: > I have an application that opens two .so files with dlopen(3): > =C2=A0/usr/local/lib/libag_core.so > =C2=A0/usr/local/lib/libag_gui.so > > Both files exist > Running nm(1) against each produces a lot of output, showing all the > symbols I know to exist in each library. > > My application gets a null return from dlopen on the libag_gui.so. > > dlerror produces the following string: > =C2=A0"/usr/local/lib/libag_gui.so Undefined symbol "agTimingLock" > > $ nm /usr/local/lib/libag_gui.so | grep agTiming > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 U agTimingLock > > I'm guessing that means that agTimingLock is used in that library but > not defined? > > $ nm /usr/local/lib/libag_core.so | grep agTiming > 0000000000141c00 B agTimingLock > > And this would mean that it is defined in libag_core.so? Yes, but it's in the uninitialized data section: % man nm ... "B" "b" The symbol is in the uninitialized data section (known as BS= S). What is the "ag" library? Which version are you using? What sort of dlopen() call did you try to run?