delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/05/15:18:18

From: gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.lang.c++,comp.os.msdos.djgpp
Subject: Re: CIN COUT
Followup-To: comp.lang.c++,comp.os.msdos.djgpp
Date: 5 Mar 1997 18:10:14 GMT
Organization: Oxford University
Message-ID: <5fkcu6$a9@news.ox.ac.uk>
References: <331BC0D5 DOT 5CB AT aracnet DOT com> <5fjr8f$3ko AT whitbeck DOT ncl DOT ac DOT uk> <331D9E02 DOT 78D4 AT serv DOT net>
NNTP-Posting-Host: mc31.merton.ox.ac.uk
Lines: 27
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Michael Rowley (stardog AT serv DOT net) wrote:
: Dazzling Dazz wrote:
: > 
: > Can Someone please tell me what is wrong with the following program.
: > I try to compile it on djgpp but I get 'undeclared' or something error.
: > Maybe I don't have the right iostream.h file?

: I havent used that compiler yet BUT i think i know whats wrong, first of 
: all, in most cmopilers main() defualts to  int main(void) So by just 
: having the line main() chances are your compiler reads it as int main 
: (void)  SO first off i would add the line  return 0;  to the end of your 
: file.... Copy this code and try to compile it....first...

DJGPP is basically gcc, and doesn't mind this too much. The actual problem
is likely to be that the original poster is not linking in the C++ libraries;
either link the code using gxx instead of gcc, or add '-liostr' to the end of
the linking line, i.e.:

gxx test.cc

or

gcc test.cc -liostr

-- 
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.

- Raw text -


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