Results 1 to 5 of 5
I'm doing my first steps in C++, bought a book called C++ for Linux, but I have problems in the very first progtam the "Hello world!". Of course I wanted ...
- 07-13-2007 #1
Where is iostream.h ?
I'm doing my first steps in C++, bought a book called C++ for Linux, but I have problems in the very first progtam the "Hello world!". Of course I wanted to compile it with gcc try.c -o try , but it answered me it cannot find iostream.h included in the source code. I'm using gcc-4.1. What's wrong ?
If you need a CD/DVD catalogizer, give a try to my program:
http://www.kde-apps.org/content/show...content=100682
Linux Usert#430188
- 07-13-2007 #2
Post your code. Did you remember to add using namespace std; at the top right after your header declarations?
Registered Linux user #270181
TechieMoe's Tech Rants
- 07-13-2007 #3
#include <iostream.h>;
using namespace std;
int main(){
cout << "Hello world !\n";
return 0;
}
ERROR>
Try.c:1:23: error: iostream.h: No such file or directoryIf you need a CD/DVD catalogizer, give a try to my program:
http://www.kde-apps.org/content/show...content=100682
Linux Usert#430188
- 07-13-2007 #4
You need to decide whether you want to write this in C or C++. You're mixing two different coding styles and compiling it with gcc. In ANSI standard C++, you do not put the .h after your header declarations. Also, cout is a C++ statement that will not be understood by the gcc compiler. Here is what I would try:
Save it as a .cpp file and compile it with this:Code:#include <iostream>; using namespace std; int main(){ cout << "Hello world !\n"; return 0; }
Code:g++ try.cpp -o try
Registered Linux user #270181
TechieMoe's Tech Rants
- 07-15-2008 #5Just Joined!
- Join Date
- Jul 2008
- Posts
- 1
LOL
Easy mate.
Nobody has born knowing these tricks!!!!.
In a windows compiler, it would run perfect!!!!
but as you know windows is a !@(*&#!(@*&#(!@*#& dam place to improve programming skills!
This guy is starting good!!!! starting in POSIX life!!!!
completing...
DAMMM MAN!!! you must to decide wheter language you want to USE!!!!!Code:#include <iostream> using namespace std; int main(){ cout << "Hello world !\n"; return 0; }

Save it as a .cpp file and compile it with this:
LOLCode:g++ try.cpp -o try


Reply With Quote
