LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2013, 09:20 AM   #1
anbarasi
LQ Newbie
 
Registered: Mar 2013
Location: bangalore
Posts: 13

Rep: Reputation: Disabled
am i rite??


#include<iostream>
int main()
{
cout<<"hello\n";
return 0;
}
i get this error
hi1.cpp:1:21: error: iostream.h: No such file or directory
hi1.cpp: In function ‘int main()’:
hi1.cpp:5: error: ‘cout’ was not declared in this scope
 
Old 03-14-2013, 09:23 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Are you missing a package containing header files?
 
Old 03-14-2013, 09:30 AM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Code:
#include<iostream>
using namespace std;
int main()
{
cout<<"hello\n";
return 0;
}
Or:

Code:
#include<iostream>
int main()
{
std::cout<<"hello\n";
return 0;
}
 
1 members found this post helpful.
Old 03-14-2013, 09:30 AM   #4
anbarasi
LQ Newbie
 
Registered: Mar 2013
Location: bangalore
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linosaurusroot View Post
Are you missing a package containing header files?
well i dnt knw!!
hw shld i install??
yum install ???
 
Old 03-14-2013, 09:43 AM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
hi1.cpp:1:21: error: iostream.h: No such file or directory
Hmmm... it looks like you are missing that header file.

Well, you're in luck because there's a thread in the Newbie forum about exactly that (what to yum install):

how to compile c++ programs in centos version

Last edited by dugan; 03-14-2013 at 09:46 AM.
 
1 members found this post helpful.
  


Reply



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
Unix "rite of passage" marsm Linux - General 10 11-15-2005 12:58 PM
Make is not for auto compilation only ... rite??? tuxfood Linux - Software 2 04-26-2005 05:14 PM
How do u know which scsi.c driver is the rite one? Spyiish Slackware - Installation 1 10-08-2004 05:43 PM
is this rite? anoop_chandran Linux - Security 0 01-26-2002 09:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration