This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Comiling C++ programs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]