Article View: gnu.gcc.help
Article #52457Re: g++ linking
From: Dan Mack
Date: Thu, 24 Sep 1992 18:17
Date: Thu, 24 Sep 1992 18:17
37 lines
1504 bytes
1504 bytes
mike@surtsey.aero.ORG (Michael J. Miller) writes: >Hello, >I'm having a problem w/ linking GNU's g++ code. The system's config. is: > SUN SPARC2, OS 4.1.2 > GNU gcc 2.2.2 > GNU libg++2.2 >and attached below is a simple program and associated error. Does anyone >have insight into the cause of this? > Thanks in advanced, Michael >------------------------------------------------------------------------- >/* How come this won't link? It appears the gcc compiler can't find it's > own libraries. How do we help it out here? > This is what I get out of the linker in response to > > gcc test.cc > >ld: Undefined symbol > > _cout > > ___ls__FR7ostreamPCc > >collect: /usr/bin/ld returned 2 exit status >*/ Mike, Here's the fix: % g++ test.cc The g++ script comes with the gcc-2.2.2 distribution. It gives gcc all the necessary options so that the libg++-2.2 library is linked with test.o. Dan
Technical Details
Message-ID:
<mack.717358299@guava>Path:
arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!spool.mu.edu!umn.edu!noc.msc.net!uc.msc.edu!shamash!timbuk.cray.com!hemlock.cray.com!mackReferences:
<9209241644.AA03885@surtsey.aero.org>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,e48446f71129f4fe X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-09-24 06:43:14 PST Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!spool.mu.edu!umn.edu!noc.msc.net!uc.msc.edu!shamash!timbuk.cray.com!hemlock.cray.com!mack From: mack@cray.com (Dan Mack) Newsgroups: gnu.gcc.help Subject: Re: g++ linking Message-ID: <mack.717358299@guava> Date: 24 Sep 92 18:17:50 GMT References: <9209241644.AA03885@surtsey.aero.org> Distribution: gnu Lines: 37