On Wed, Aug 12, 2009 at 07:42:52PM +0530, Gaurang Aggarwal wrote:
> Hi ,
> 
> 
> I need help . I am using g++ in ubuntu 9.04 .

First of all, please do NOT recycle threads. That is, please do NOT
click reply on a mail and then compose your mail and send it to the
list. Please compose a fresh mail with a relevant subject.

> This is C++ code .
[snip code]
> qwerz...@ubuntu:~$ g++ ./cpp1.cpp
> ./cpp1.cpp:2:19: error: conio.h: No such file or directory
> ./cpp1.cpp:3: error: '::main' must return 'int'
> ./cpp1.cpp: In function 'int main()':
> ./cpp1.cpp:6: error: 'cout' was not declared in this scope
> ./cpp1.cpp:7: error: 'cin' was not declared in this scope
> ./cpp1.cpp:10: error: 'getch' was not declared in this scope

conio.h: from the Wikipedia article:
"Most C compilers that target UNIX and Linux do not have this header
and do not supply the concomitant library functions. Some embedded
systems are using conio-compatible library."

See http://en.wikipedia.org/wiki/Conio.h for details.

As for your cout and cin errors, you should either specify them with
their namespaces, e.g. as std::cin and std::cout, or allow inclusion
of all the standard library namespace labels without having to
explicity refer to them by saying

using namespace std;

somewhere near the top of the file.

HTH.

Kumar

P. S. Please also read this, if you haven't done so already:
http://catb.org/~esr/faqs/smart-questions.html

_______________________________________________
ilugd mailinglist -- ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/ilugd@lists.linux-delhi.org/

Reply via email to