View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-15-2011, 09:58 AM   #1
LQ Newbie
Registered: May 2011
Posts: 1

Rep: Reputation: 0
Can't compile c++ programs on OPENSUSE

Hi der
the foll. pgm of mine is not getting compiled
int main()
}//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
Old 05-15-2011, 10:01 AM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,701

Rep: Reputation: 566Reputation: 566Reputation: 566Reputation: 566Reputation: 566Reputation: 566
Program error. Do
std::cout <<"Hi\n";
using namespace std;
and compile with g++


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
openSUSE 11 fails to launch programs capeschools Linux - Software 1 08-12-2009 09:54 AM
Trying to install programs and PC wants the opensuse 11 disk trailer8713 Linux - Newbie 1 11-19-2008 04:56 AM
Unable to compile my programs ranjit.singh Linux - Newbie 1 10-29-2008 11:46 PM
how should i compile c programs?? vbnandu86 Fedora 3 09-01-2006 08:15 AM
cannot compile c programs umeshpandey007 Linux - Newbie 7 08-29-2005 10:19 PM

All times are GMT -5. The time now is 11:25 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration