LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't compile c++ programs on OPENSUSE (http://www.linuxquestions.org/questions/linux-newbie-8/cant-compile-c-programs-on-opensuse-880825/)

g_v 05-15-2011 08:58 AM

Can't compile c++ programs on OPENSUSE
 
Hi der
the foll. pgm of mine is not getting compiled
#include<iostream>
int main()
{
cout<<"Hi\n";
}//Saved as g.cpp

The foll. error is shown on compiling as c++ g.cpp or gcc c.cpp or cc g.cpp
and i've gcc 4.5

g.cpp: In function ‘int main()’:
g.cpp:5:2: error: ‘cout’ was not declared in this scope
v

AlucardZero 05-15-2011 09:01 AM

Program error. Do
Code:

std::cout <<"Hi\n";
or
Code:

#include<iostream>
using namespace std;

and compile with g++


All times are GMT -5. The time now is 02:17 PM.