LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-28-2004, 01:10 AM   #1
ambuj
LQ Newbie
 
Registered: Nov 2003
Posts: 10

Rep: Reputation: 0
"#include <iostream.h>" does not compile


i am compiling c++ file on linux7.1, but its giving error......

iostream.h file not found...

can anybody help me out.......

i am using command....
cc abc.cpp

and also...
cc abc.c

but its not woking..
 
Old 01-28-2004, 01:36 AM   #2
linuXBOX
Member
 
Registered: Jul 2003
Location: Stuart,FL
Distribution: Fedora Core 3 and Slackware 10.0
Posts: 179

Rep: Reputation: 30
I don't mean to sound like a smart-ass, but apparently you don't have the iostream libraries. Try to reinstall cc, or visit their to site to perhaps download and install iostream libraries.
 
Old 01-28-2004, 01:40 AM   #3
ambuj
LQ Newbie
 
Registered: Nov 2003
Posts: 10

Original Poster
Rep: Reputation: 0
Cool its done

my code is working now....
 
Old 01-28-2004, 02:01 AM   #4
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 30
If you want to compile C++, try using g++ instead of cc.
 
Old 01-28-2004, 06:23 AM   #5
DaFrEQ
Member
 
Registered: Mar 2002
Location: Earth... for now
Distribution: SuSE9.2 AMD64; LFS; GentooAMD64; Ubuntu10.04; RHEL 5.5; Solaris10(SPARC)
Posts: 418

Rep: Reputation: 30
gcc also works well.
 
Old 01-28-2004, 06:43 AM   #6
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 30
gcc is for c code and g++ is for C++. Since we have C++ code here, I think we have to use g++. gcc just gives a bunch of errors if we try to compile C++ using it(though it is technically possible to compile C++ code using gcc).
 
Old 01-28-2004, 07:00 AM   #7
DaFrEQ
Member
 
Registered: Mar 2002
Location: Earth... for now
Distribution: SuSE9.2 AMD64; LFS; GentooAMD64; Ubuntu10.04; RHEL 5.5; Solaris10(SPARC)
Posts: 418

Rep: Reputation: 30
I use gcc for my C and C++. It is possible, but I guess for the beginner it's probably better to use the g++ as you said.

Then again, if it is Linux, you could always use one of the IDEs.
Anjuta works pretty well. I really like the way it seperates your functions with the expandable panes. Quite nice and handy when dealing with an enourmous amount of code.
 
Old 01-28-2004, 08:56 AM   #8
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
Just another observation.... in C++ you drop the .h. #include <iostream> is the wy you are supposed to use it.
 
  


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
Configuring Boot Process on Mandrake 10 to include command "ifup eith0" Bennyjamin Linux - Hardware 3 12-27-2004 04:22 PM
C++ iostream - getting "deprecated header" error jdruin Programming 3 09-28-2004 07:31 AM
Clarifiacation on header file "/usr/include/a.out.h" swathisat Linux - Software 0 09-05-2003 12:12 AM
sendmail: "permission denied" when using include:/file sohmc Linux - Software 1 05-22-2003 06:40 AM
What is correct code for "Include File Function" on .asp pages gregoryfrancis Linux - General 1 02-11-2003 10:49 PM


All times are GMT -5. The time now is 02:55 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