public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* string class and iostream
@ 2002-11-07  6:53 Lele Rizzo
  2002-11-07  6:54 ` Michal Lipták
  0 siblings, 1 reply; 2+ messages in thread
From: Lele Rizzo @ 2002-11-07  6:53 UTC (permalink / raw)
  To: gcc-help

Hello to all, someone may help me pls?!
i've just installed RedHat 8 (with gcc 3.2.7),i tryed to compile the
following file:
------ file beginning -------
#include <iostream>
#include <string>
int main()
{
   string aa="Hello\n";
   cout << aa;
   return 1;
}
------- file end ---------
But i get the following error message:

[sliverd@casa cpp]$ g++ bb.cpp -o bb
bb.cpp: In function `int main()':
bb.cpp:5: `string' undeclared (first use this function)
bb.cpp:5: (Each undeclared identifier is reported only once for each
function 
   it appears in.)
bb.cpp:5: parse error before `=' token
bb.cpp:6: `cout' undeclared (first use this function)
bb.cpp:6: `aa' undeclared (first use this function)
[sliverd@casa cpp]$

i tryed to include even other library (like string, string.h,
stdio.h...etc..), 
but it never compile!

Thanks
Lele Rizzo


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: string class and iostream
  2002-11-07  6:53 string class and iostream Lele Rizzo
@ 2002-11-07  6:54 ` Michal Lipták
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Lipták @ 2002-11-07  6:54 UTC (permalink / raw)
  To: gcc-help

use std::string

> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org 
> [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Lele Rizzo
> Sent: Thursday, November 07, 2002 3:53 PM
> To: gcc-help
> Subject: string class and iostream
> 
> 
> Hello to all, someone may help me pls?!
> i've just installed RedHat 8 (with gcc 3.2.7),i tryed to compile the
> following file:
> ------ file beginning -------
> #include <iostream>
> #include <string>
> int main()
> {
>    string aa="Hello\n";
>    cout << aa;
>    return 1;
> }
> ------- file end ---------
> But i get the following error message:
> 
> [sliverd@casa cpp]$ g++ bb.cpp -o bb
> bb.cpp: In function `int main()':
> bb.cpp:5: `string' undeclared (first use this function)
> bb.cpp:5: (Each undeclared identifier is reported only once for each
> function 
>    it appears in.)
> bb.cpp:5: parse error before `=' token
> bb.cpp:6: `cout' undeclared (first use this function)
> bb.cpp:6: `aa' undeclared (first use this function)
> [sliverd@casa cpp]$
> 
> i tryed to include even other library (like string, string.h,
> stdio.h...etc..), 
> but it never compile!
> 
> Thanks
> Lele Rizzo
> 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-07 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-07  6:53 string class and iostream Lele Rizzo
2002-11-07  6:54 ` Michal Lipták

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).