delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/08/21:04:49

Sender: nate AT cartsys DOT com
Message-ID: <36E48160.99F5AF0F@cartsys.com>
Date: Mon, 08 Mar 1999 18:03:12 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.1 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Can't compile Hello World!!!
References: <7c0l5l$1dt$1 AT nnrp1 DOT dejanews DOT com> <7c14vr$1t8u$1 AT quince DOT news DOT easynet DOT net> <7c1ecj$p6o$1 AT nnrp1 DOT dejanews DOT com>
Reply-To: djgpp AT delorie DOT com

john_maple AT yahoo DOT com wrote:
> 
> > >If I compile within
> > >RHIDE and say "Build All" the object file gets created but in the file
> > >compile to the .exe, it fails.
> 
> To clarify, RHIDE gives this error in the status bar:
> Creating: hello.exe
> Error: c:djgpp/bin/ld.exe: Cannot open -lstdcx: No such file or directory
> (ENOENT)

See FAQ section 8.7.

> > >If I compile directly on the DOS command line with "gcc hello.cc -o
> > >hello.exe" I get the following errors:
> > >
> > >c:/djgpp/tmp\cccixyke(.text+0x19):hello.cc:undefined reference to `cout'
> > >c:/djgpp/tmp\cccixyke(.text+0x19):hello.cc:undefined reference to
> > >`ostream::operator(char const *)'
> 
> Are these different errors, or are they two versions of the same error based
> on whether I am compiling the executable from the command line vs. RHIDE.  Or
> are they merely symptoms of a larger problem?

When you just use `gcc', the C++ libraries (different from the headers)
are not linked, and so neither `cout' nor ostream's `(char const *)'
operator can be found.  You are supposed to use `gxx' to link (create an
executable) for C++, as the README.1ST explains.  Or else add `-lstdcxx'
to the command line manually.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019