|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
compiling a simple script in linux
I just installed RedHat 8.0 on my computer, and when I try to compile a simple c++ program, I get a strange warning about the header include. See:
http://users.pandora.be/fourtyseven/cplus.jpg If I remove the '.h' part in the include, I don't get this warning anymore, but then of course it says that 'cout' is undeclared. Could anyone help? Thanks. Last edited by poring : December 29th, 2002 at 01:39 PM. |
|
#2
|
||||
|
||||
|
I could not replicate your problem on my SuSE box. On my box, the program includes the /usr/include/g++/iostream.h file. Your error message says that its including the /usr/include/c++/backward/iostream.h file. The word backward in the path indicates to me that this may be an older file that is included for backward compatability. My guess is that you're using the "wrong" iostream.h file and need to adjust some settings on your machine so your compiles look at a different include directory.
Also, if you want to leave the .h off your include files, you might want to look at the following post: http://forums.devshed.com/showthread.php?threadid=45679 |
|
#3
|
|||
|
|||
|
First, compiling from within emacs can be problematic. I generally prefer to work from a command line.
Second, try the following code to accomplish the same goals: Code:
#include <iostream>
using namespace std;
int main() {
cout << "Hello" << endl;
return 0;
}
The STL libraries do not use the .h extension, although typically there is a link to the file with a .h extension roaming around on the hard drive. Everything in the STL libraries is within the std namespace, so having that in place will help.
__________________
Clay Dowling Lazarus Notes Articles and commentary on web development http://www.lazarusid.com/notes/ |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > compiling a simple file in linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|