www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/03/02:47:36

From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: (none)
Date: 3 Nov 1997 06:37:29 GMT
Organization: The National Capital FreeNet
Lines: 34
Message-ID: <63jrf9$obu@freenet-news.carleton.ca>
References: <199711021312 DOT OAA15278 AT vitellius DOT mbfys DOT kun DOT nl>
Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
NNTP-Posting-Host: freenet2.carleton.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Jos van Riswick (josvanr AT mbfys DOT kun DOT nl) writes:
> Hello, 
> 
>       I'm learning c++, and I'm using djgpp and bcc. The first
>       program I wrote, called test.cc reads:
> 
> #include <iostream.h>
> 
> void main() {
> 
> 	cout << "Hallo";
> 
> }
> 
>       It compiles fine with bcc. However, gcc, no. It doesn't 
>       compile.

Evidently, BCC includes the stream library when linking, automatically.
GCC does not.

gcc test.cc -o test.exe -liostr

works.

There's a shortcut:

gxx test.cc -o test.exe will automagically link iostreams if you use them
in test.cc.
--
    .*.  Where feelings are concerned, answers are rarely simple [GeneDeWeese]
 -()  <  When I go to the theater, I always go straight to the "bag and mix"
    `*'  bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh

- Raw text -


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