This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Comiling C++ programs
- To: "Awadhesh Prasad" <Awadhesh dot Prasad at mdbc dot gov dot au>
- Subject: Re: Comiling C++ programs
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 06 Aug 2001 01:45:09 -0300
- Cc: <gcc-help at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <sb6eab81.036@mdtrout>
On Aug 6, 2001, "Awadhesh Prasad" <Awadhesh.Prasad@mdbc.gov.au> wrote:
> I am unable to compile C++ program containing standard inpuut/output statements like following simple statements:
> cout << " Hello world\n"
> cin >> avariable
Well, for a start, you're missing the semicolons, and this should
appear inside a function. But you probably already know that, you
just failed to make it clear in your posting.
> For some reasons the compiler is not recognising cout/cin even
> though <iostream.h> file has been included. I guess I am commiting
> some basin mistake. An early tip will be highly appreciated.
Which command are you using to compile and link your program? Make
sure you use g++, not gcc, otherwise the C++ standard library won't be
implicitly linked in.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me