www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/08/15:34:07

Date: Sat, 8 Nov 1997 12:32:36 -0800 (PST)
Message-Id: <199711082032.MAA01373@adit.ap.net>
Mime-Version: 1.0
To: =?iso-8859-1?Q?=22Bj=F6rn_Landsberg=22?= <e95_bla AT e DOT kth DOT se>,
djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Compile and link C++ program

At 10:04  11/5/1997 +0100, Björn Landsberg wrote:
>Hi,
>Im just trying to get started with djgpp.
>But I get error messages when I try to compile a simple hello world c++
>program. That is when i've included iostream.h and try to use:
>cout << "bla bla...";
>
>I get the message "undefined reference to cout".
>If I use the -c  option when I call gcc, wich skips the linking, I get no
>errors. I also tried -O wich I read somewhere.
>
>Whats wrong? Ive read the helpfiles and desperatley tried various
>combinations of different command-line arguments, without success.
Did you read README.1ST? It says that to link a C++ program, you have to
link the C++ libraries as well. A shortcut is to use `gxx' in place of
`gcc', which does this for you.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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