From owner-freebsd-bugs@FreeBSD.ORG Wed May 21 06:44:41 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31C1937B401; Wed, 21 May 2003 06:44:41 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0EA743FAF; Wed, 21 May 2003 06:44:40 -0700 (PDT) (envelope-from gerald@FreeBSD.org) Received: from freefall.freebsd.org (gerald@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h4LDieUp035768; Wed, 21 May 2003 06:44:40 -0700 (PDT) (envelope-from gerald@freefall.freebsd.org) Received: (from gerald@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h4LDiew9035764; Wed, 21 May 2003 06:44:40 -0700 (PDT) Date: Wed, 21 May 2003 06:44:40 -0700 (PDT) From: Gerald Pfeifer Message-Id: <200305211344.h4LDiew9035764@freefall.freebsd.org> To: bostic@sleepycat.com, gerald@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: gnu/13525: gcc fails load against library with both C++ and C modules X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2003 13:44:41 -0000 Synopsis: gcc fails load against library with both C++ and C modules State-Changed-From-To: feedback->closed State-Changed-By: gerald State-Changed-When: Wed May 21 06:41:18 PDT 2003 State-Changed-Why: I debugged this in further depth, and it is apparently operator error: As soon as you use any C++ library routines (whether directly or indirectly) you need to link the final binary using g++, not gcc, and the g++ driver then will link any additional libraries required. The following would have worked for the example provided: gcc -Wall -c -fpic a.c c++ -Wall -c -fpic b.cc gcc -shared -o libab.so a.o b.o gcc -Wall -c c.c c++ -o c c.o ./libab.so http://www.freebsd.org/cgi/query-pr.cgi?pr=13525