From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10603 invoked by alias); 12 Oct 2002 01:45:03 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 10594 invoked from network); 12 Oct 2002 01:45:02 -0000 Received: from unknown (HELO joe?linux.adwriter.com) (63.237.157.33) by sources.redhat.com with SMTP; 12 Oct 2002 01:45:02 -0000 Received: from desktop.adwriter.com (cblmdm207-42-72-127.buckeye-express.com [207.42.72.127]) (authenticated) by joe_linux.adwriter.com (8.11.6/8.11.6) with ESMTP id g9C1isr27916; Fri, 11 Oct 2002 21:44:54 -0400 Subject: Re: GCC 3.2 Linker Problem with C, C++ and GNU Prolog code From: Joseph Benden To: Joseph Benden Cc: gcc-help@gcc.gnu.org In-Reply-To: <1034341524.12269.15.camel@joe_linux.adwriter.com> References: <1034341524.12269.15.camel@joe_linux.adwriter.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 11 Oct 2002 18:45:00 -0000 Message-Id: <1034387101.9677.1.camel@desktop.adwriter.com> Mime-Version: 1.0 X-SW-Source: 2002-10/txt/msg00136.txt.bz2 Nevermind. It was a problem in the GNU Prolog include header. For anyone else having the problem, define the below variables as extern within the gprolog.h include. This was with gprolog 1.2.14 Joseph Benden, Sr., CCNA Vice President of Information Technology AdWriter, Inc. Professional Member of the Association of Computing Machinery (www.ACM.org) Professional Member of the Network and System Professionals Association (www.NaSPA.org) On Fri, 2002-10-11 at 09:05, Joseph Benden wrote: > I'm having a problem linking together the three mentioned object files > above using GCC 3.2. If I specify the --allow-multiple-definition flag > to the linker, the objects do indeed link and work; however, on GCC 2.96 > (RedHat 7.3) it all links together fine. > > I'm confused as to why, but don't like the fact that I must add the > above flag. Also, it doesn't properly compile on 2.96 (RedHat 7.1). > > The code uses a ton of STL containers (strings, vectors,) GNU Prolog, > expat, mysql, etc. > > The errors messages which I'm receiving are: > > > > prefork.o(.bss+0x0): multiple definition of 'last_read_line' > child.o(.bss+0x4): first defined here > prefork.o(.bss+0x4): multiple definition of 'last_read_col' > child.o(.bss+0x8): first defined here > prefork.o(.bss+0x8): multiple definition of 'byte_code' > child.o(.bss+0xc): first defined here > CEpilog.o(.bss+0x0): multiple definition of 'last_read_line' > child.o(.bss+0x4): first defined here > > ... and a couple more of the same above type errors ... > > All of the object mentioned above are C++ objects. There are no > complaints from the linker about libraries, C objects or GNU Prolog > objects. > > I've looked at the assembly code generated, but can not figure out where > these above names are defined... They're not in my code nor in the > header files of libraries I'm using... Do these errors have something > to do with the STL? > > I'm lost... I've searched around, but can not figure this one out... > > Thanks, > Joseph Benden, Sr., CCNA > Vice President of Information Technology > AdWriter, Inc. > > Professional Member of the Association of Computing Machinery (www.ACM.org) > Professional Member of the Network and System Professionals Association (www.NaSPA.org) > > >