delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/01/14/10:31:35

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Thomas8675309 AT yahoo DOT com (Tom)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: errors
Date: 14 Jan 2004 07:15:47 -0800
Organization: http://groups.google.com
Lines: 38
Message-ID: <7b68d58f.0401140715.444a520@posting.google.com>
References: <505545170 DOT 20040114111338 AT surfeu DOT fi>
NNTP-Posting-Host: 63.72.148.162
X-Trace: posting.google.com 1074093347 20726 127.0.0.1 (14 Jan 2004 15:15:47 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Wed, 14 Jan 2004 15:15:47 +0000 (UTC)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Prior <prior AT surfeu DOT fi> wrote:

> I am newbie in DJGPP... so
> 
> here is test.cc file
> 
> #include <iostream.h>
> 
> int main()
> {
> cout << "dsfdsf";
> return 0;
> }
> 
> and I do: gcc -Wall -Wno-deprecated test.cc -o test.exe

[linker errors snipped]

> what is wrong? what should i do?

You should have used "gpp" rather than "gcc":

gpp -Wall -Wno-deprecated test.cc -o test.exe

Unlike gcc, gpp links in the C++ library.  If you use "gcc" as your
command, you would have to list the c++ library explicitly, which you
didn't do.  And since you didn't, the linker can't find cout, etc., so
it complains, leading to your error messages.

(And Hans-Bernhard Broeker is correct that you need to get yourself
and up-to-date C++ textbook.  "iostream.h" has been deprecated (or, if
you're pedantic, simply nonstandard) since 1998.  Code it right and
stop using "-Wno-deprecated."  But that has nothing to do with the
linker error you got.)

Best regards,

Tom

- Raw text -


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