From owner-freebsd-questions@FreeBSD.ORG Fri Aug 19 19:13:42 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 C625916A41F for ; Fri, 19 Aug 2005 19:13:42 +0000 (GMT) (envelope-from jcm@FreeBSD-uk.eu.org) Received: from yearning.mcc.ac.uk (yearning.mcc.ac.uk [130.88.203.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36F3043D48 for ; Fri, 19 Aug 2005 19:13:41 +0000 (GMT) (envelope-from jcm@FreeBSD-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97]) by yearning.mcc.ac.uk with esmtp (Exim 4.51 (FreeBSD)) id 1E6CJ8-000Mp1-Hn for freebsd-questions@freebsd.org; Fri, 19 Aug 2005 20:13:39 +0100 Received: from dogma.freebsd-uk.eu.org (localhost [127.0.0.1]) by dogma.freebsd-uk.eu.org (8.13.1/8.13.1) with ESMTP id j7JJDbVQ076606 for ; Fri, 19 Aug 2005 20:13:37 +0100 (BST) (envelope-from jcm@dogma.freebsd-uk.eu.org) Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.13.1/8.12.6/Submit) id j7JJDbSn076605 for freebsd-questions@freebsd.org; Fri, 19 Aug 2005 20:13:37 +0100 (BST) Date: Fri, 19 Aug 2005 20:13:36 +0100 From: Jonathon McKitrick To: freebsd-questions@freebsd.org Message-ID: <20050819191335.GA76538@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Subject: Forcing symbol resolution in lib rather than bin 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: Fri, 19 Aug 2005 19:13:42 -0000 I have a binary that links to a shared object library. That .so calls a routine in an archive library (.a). When I link the main app with -lar-a it works fine, even though the function is actually called in the .so. But when I link the .so with -lar-a, the linker doesn't resolve the symbol! So, here's the call graph: bin --> shared --> archive If I link bin to shared and archive, it works. But if I link shared to archive, and then bin to shared, it doesn't, even though the shared object calls the archived function, rather than bin. What basic link concept am I missing here? Thanks in advance, jm --