Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 05-10-2003, 02:48 PM   #1
LQ Newbie
Registered: May 2003
Posts: 3

Rep: Reputation: 0
Question compiling c++ on red hat linux 9

i just installed red hat linux 9. i tried compiling a simple c++ program. gcc, g++. and cc cant seem to find cout even though im including iostream.h. the error is "'cout' undeclared".
is there a package i need to get? tha.

Last edited by eschneid; 05-10-2003 at 03:49 PM.
Old 05-10-2003, 04:01 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
try iostream, iostream.h is deprecated.

Old 05-10-2003, 04:11 PM   #3
LQ Newbie
Registered: May 2003
Posts: 3

Original Poster
Rep: Reputation: 0
i have tried both.
Old 05-10-2003, 05:46 PM   #4
LQ Guru
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
tyr this
#include <iostream>
using namespace std;
Old 05-11-2003, 06:30 AM   #5
LQ Newbie
Registered: May 2003
Posts: 3

Original Poster
Rep: Reputation: 0
that worked. thanks. whats the deal? is this a new standard or something?
Old 05-11-2003, 11:45 AM   #6
Registered: Jul 2002
Location: New York
Distribution: Red Hat 7.2, SuSE 7.3
Posts: 60

Rep: Reputation: 15
that worked. thanks. whats the deal? is this a new standard or something?
This was standardized back in 2000, though established long before that. When you use iostream.h, you are essentially writting "C" and compiling it with a C++ compiler.


using namespace std; // VERY bad thing, don't do this

rather, use namespace scoping:

#include <iostream>

int main( int argc, char** argv ) {

std::cout << "Hello World" << std::endl;

return( 0 );



if it really annoys you to type the extra, then at least
minimize the impact of your global declaration by:

using std::cout


If you are entirely unfamiliar with namespaces,
it will be worth your while to invest ten minutes
reading up on the subject, it is a very simple topic.



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
error compiling NTFS driver for Red Hat 9 WMD Red Hat 0 07-26-2004 01:17 PM
Red Hat does not plan to release another product in the red hat linux line... Whitehat General 5 11-03-2003 06:33 PM
Compiling Kernel in Red Hat 9 quovadismaximus Linux - Newbie 2 09-29-2003 11:02 AM
Red Hat Enterprise vs. Red Hat Linux Project RedHatMN Linux - Distributions 2 07-29-2003 04:16 AM
compiling red hat 8.0 kernel? menahem Linux - Software 1 03-22-2003 09:46 PM

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