www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/03/28/00:48:50

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-ID: <3CA2AD96.4575D584@earthlink.net>
From: Martin Ambuhl <mambuhl AT earthlink DOT net>
Organization: Nocturnal Aviation
X-Mailer: Mozilla 4.77 [en] (Win95; U)
X-Accept-Language: en,de-CH,fr,ru,zh-CN,ja
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem with gpp
References: <42eb17dc DOT 0203271829 DOT 46409ed5 AT posting DOT google DOT com>
Lines: 45
Date: Thu, 28 Mar 2002 05:42:55 GMT
NNTP-Posting-Host: 63.210.218.215
X-Complaints-To: abuse AT earthlink DOT net
X-Trace: newsread1.prod.itd.earthlink.net 1017294175 63.210.218.215 (Wed, 27 Mar 2002 21:42:55 PST)
NNTP-Posting-Date: Wed, 27 Mar 2002 21:42:55 PST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Wither wrote:
> 
> I tested simple program as following.
> 
> #test.cc
> #include <string>
> #include <iostream.h>
> 
> main()
> {
>   string s("Hello!");
>   cout << s.c_str() << endl;
> }
> 
> I was prompted errors when I compiled it by gpp command.
> 
> c:\test>gpp test.cc
> main.c: In function `int main()':
> main.c:11: `string' undeclared (first use this function)
> main.c:11: (Each undeclared identifier is reported only once for each function
>    it appears in.)
> main.c:11: parse error before `(' token
> main.c:13: `s' undeclared (first use this function)
> 
> Actually, I found file "string" under directory "c:\djgpp\lang\cxx-v3".
> 
> can anyone help me!


Apply these changes to make your code comply with the C++ standard.

  2c2,3
  < #include <iostream.h>
  ---
  > #include <iostream>
  > using namespace std;
  4c5
  < main()
  ---
  > int main()

-- 
It is better that the grammarians should chide us
than that the people should not understand us.
  - St. Augustine

- Raw text -


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