dleroy
December 15th, 2007, 11:16 AM
I am using "Gusty" and trying to compile this very basic program
"C" program named hello.c
#include <iostream>
int main()
{
cout << "Hello World \n ";
return 0;
}
I get the following error :
leroy@ub4:~/c++$ gcc hello.c
hello.c:1:20: error: iostream: No such file or directory
hello.c: In function ‘main’:
hello.c:6: error: ‘cout’ undeclared (first use in this function)
hello.c:6: error: (Each undeclared identifier is reported only once
hello.c:6: error: for each function it appears in.)
I have checked the library paths for the compiler and it uses /usr/include/c++/4.1.3 which includes the header iostream
no matter which compiler I try , c++,cpp,gpp,g++ I get various errors , all of which are related to header files. I read lots of posts about various compiler problems with Ubuntu. Can you actual compile code "C" on this Ubuntu system. The build-essentials is installed and many other things which the posts say is a problem have also given no results. Does this work ?? . Show an example of some actual code compiled on this OS.
Thanks
"C" program named hello.c
#include <iostream>
int main()
{
cout << "Hello World \n ";
return 0;
}
I get the following error :
leroy@ub4:~/c++$ gcc hello.c
hello.c:1:20: error: iostream: No such file or directory
hello.c: In function ‘main’:
hello.c:6: error: ‘cout’ undeclared (first use in this function)
hello.c:6: error: (Each undeclared identifier is reported only once
hello.c:6: error: for each function it appears in.)
I have checked the library paths for the compiler and it uses /usr/include/c++/4.1.3 which includes the header iostream
no matter which compiler I try , c++,cpp,gpp,g++ I get various errors , all of which are related to header files. I read lots of posts about various compiler problems with Ubuntu. Can you actual compile code "C" on this Ubuntu system. The build-essentials is installed and many other things which the posts say is a problem have also given no results. Does this work ?? . Show an example of some actual code compiled on this OS.
Thanks