delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/07/08:49:11

Date: Tue, 7 Oct 1997 14:47:06 +0200 (MET DST)
From: Wojciech Piechowski <voyt AT delta DOT ds2 DOT pg DOT gda DOT pl>
To: Antonio Dias <accdias AT provider DOT com DOT br>
cc: djgpp AT delorie DOT com
Subject: Re: C++ compiler error
In-Reply-To: <3439A62A.C41462FD@provider.com.br>
Message-ID: <Pine.GSO.3.96.971007144518.23983C-100000@delta.ds2.pg.gda.pl>
MIME-Version: 1.0


On Tue, 7 Oct 1997, Antonio Dias wrote:

> Hi, 
> 
> I installed all the necessary files for C++ compilation under DJGPP and
> all environment variables are correctly set. Now I'm trying to compile a
> single hello.cc and I'm getting the following error messages:
> 
> d:/djgpp/tmp\ccdaaaaa(.text+0x1a):hello.cc: undefined reference to
> `endl(ostream
>  &)'
> d:/djgpp/tmp\ccdaaaaa(.text+0x24):hello.cc: undefined reference to
> `cout'
> d:/djgpp/tmp\ccdaaaaa(.text+0x29):hello.cc: undefined reference to
> `ostream::ope
> rator<<(char const *)'
> d:/djgpp/tmp\ccdaaaaa(.text+0x34):hello.cc: undefined reference to
> `ostream::ope
> rator<<(ostream &(*)(ostream &))'
> 
> The hello.cc program is typed as follows:
> 
> ////////////////////////////////
> // 
> // hello.cc
> //
> #include <iostream.h>
> 
> int main () {
>     cout << "Hello world!" << endl ;
> }
> 
> 
> Does anyone can help-me?
> 
> TIA,
> Antonio Dias <accdias AT provider DOT com DOT br>
> 


You have to link with iostream library:
gcc -o hello.exe hello.cc -liostream

- Raw text -


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