LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 05-15-2011, 08:58 AM   #1
g_v
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
#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
 
Old 05-15-2011, 09:01 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,610

Rep: Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518
Program error. Do
Code:
std::cout <<"Hi\n";
or
Code:
#include<iostream>
using namespace std;
and compile with g++
 
  


Reply


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 08:54 AM
Trying to install programs and PC wants the opensuse 11 disk trailer8713 Linux - Newbie 1 11-19-2008 03:56 AM
Unable to compile my programs ranjit.singh Linux - Newbie 1 10-29-2008 10:46 PM
how should i compile c programs?? vbnandu86 Fedora 3 09-01-2006 07:15 AM
cannot compile c programs umeshpandey007 Linux - Newbie 7 08-29-2005 09:19 PM


All times are GMT -5. The time now is 11:49 AM.

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