delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/13/02:03:06

From: dbarrett AT khaki DOT engin DOT umich DOT edu (David M Barrett)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: More compiler problems
Date: 13 Oct 1996 05:11:48 GMT
Organization: University of Michigan Engineering, Ann Arbor
Lines: 25
Message-ID: <53ptmk$t1q@srvr1.engin.umich.edu>
References: <1996Oct10 DOT 005737 DOT 147622 AT forest> <53k2qt$k47 AT news DOT onramp DOT net>
NNTP-Posting-Host: khaki.engin.umich.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mark Edwards (medwards AT onramp DOT net) wrote:
: ebromber AT forest DOT drew DOT edu wrote:

: >I wrote a small program that prints TEST to the screen to test if the 
: >compiler was working. Unfortunately, there were two error messages 
: >displayed when i tried to compile the file. Below is a copy of the program 
: >and the two error messages. I have also posted the results of typing set 
: >>environ.lst at the dos prompt as well as my autoexec.bat file. Any help 
: >is greatly appreciated.

: >Two error messages after typing gcc test.cc
: >test.cc(.text+0x16)undefined reference to 'cout'
: >test.cc(.text+0x1b)undefined reference to 'ostream::operator <<(char const 

I'd guess that you need to link in the C++ library:

gcc -g -o blah.c -c blah.cc -lgpp

-David :)

-----------------------------------------------------------------------------
 David M. Barrett :)         |   University of Michigan / Vizlab Counselor
 dbarrett AT engin DOT umich DOT edu    | http://www-personal.engin.umich.edu/~dbarrett
-----------------------------------------------------------------------------

- Raw text -


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