delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/30/13:48:55

From: kagel AT quasar DOT bloomberg DOT com
Date: Tue, 30 Jul 1996 13:40:35 -0400
Message-Id: <9607301740.AA02848@quasar.bloomberg.com >
To: eliz AT is DOT elta DOT co DOT il
Cc: j DOT hendriks AT student DOT utwente DOT nl, djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.960730174810.660C-100000@is> (message from Eli Zaretskii on Tue, 30 Jul 1996 17:50:33 +0200 (IST))
Subject: Re: Problem with undefined references in DJGPP v2.0
Reply-To: kagel AT dg1 DOT bloomberg DOT com

   Errors-To: postmaster AT ns1
   Date: Tue, 30 Jul 1996 17:50:33 +0200 (IST)
   From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
   X-Sender: eliz AT is
   Cc: djgpp AT delorie DOT com
   Mime-Version: 1.0
   Content-Type: TEXT/PLAIN; charset=US-ASCII
   Content-Length: 512


   On 28 Jul 1996, Jasper Hendriks wrote:

   > Im experiencing a problem when i compile (gcc test.cc) the following 
   > program:
   > 
   > #include <stdio.h>
   > void main()
   > {
   >   cout << "hello world!";
   > }
   > 
   > I get the following message:
   > test.cc(.text+0x37): undefined reference to `cout'
   > test.cc(.text+0x3c): undefined reference to `ostream::operator<<(char const 
   > *)'

   Please download the DJGPP FAQ list (v2/faq201b.zip from the same place 
   you get DJGPP) and read section 8.7 of the FAQ, which explains this.

You do not report the compile command line you used, but, I suspect it was something
like:

gcc -o test test.cc

This should have been:

gpp -o test test.cc

The gpp driver adds library references to the standard C++ libraries which gcc does 
not.  If you do not have gpp get the zip from the same place you got DJGPP.

-- 
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com

A proverb is no proverb to you 'till life has illustrated it.  -- John Keats

- Raw text -


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