Comiling C++ programs
Alexandre Oliva
aoliva@redhat.com
Sun Aug 5 21:46:00 GMT 2001
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
More information about the Gcc-help
mailing list