delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/16/20:45:18

From: "DeHackEd" <Not DOT given AT out>
References: <01bd5112$e22b6d80$940c9ace AT frank DOT mtsu DOT edu DOT frank DOT mtsu DOT edu>
Subject: Re: undefined reference to...
Date: Mon, 16 Mar 1998 20:29:13 -0500
Lines: 16
Message-ID: <utPIXRUU9GA.346@upnetnews02.moswest.msn.net>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

It's a C++ thing. cout is a special object that is native to C++. GCC only links
in C things. If you want C++ things like streams, then change your command line:

C:\DJGPP\MYPROGS>gcc test.cc -o test.exe -lgpp -lstdcx
or
C:\DJGPP\MYPROGS>gxx test.cc -o test.exe

-l as in link. The first one is usually enough, stdcx is several other things
inculded in C++. I just use gxx if I am going to use these things. It's easier.
--
"DeHackEd"

EMail address not given out due to low-life spammers.
Very funny Scotty. Now beam down my clothes.


- Raw text -


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