Click to See Complete Forum and Search --> : iostream.h - hello.cpp?
elpresidente
02-23-2001, 01:05 AM
Ok. I got emacs installed and can write and save a file. I have this book, "Teach yourself C++ programming in 21 days" and I'm trying to compile the first program in the book. so I:
gcc hello.cpp -o hello
and recieve:
hello.cpp:1:iostream.h:No such file or directory
What now?
Fandelem
02-23-2001, 01:08 AM
i had the exact problem ;o)
c++ hello.cpp -o hello
should work.
cheers,
~kyle
f'lar
02-23-2001, 01:20 AM
or g++
TetsuoII
02-23-2001, 06:26 AM
It's been a while since I have programmed in Linux (doing a project in WinBlows, aaargh!), but I think the reason you get this error is that you haven't installed the devel versions of your libraries. Try to see if you can find the file with 'locate' and if not you need the developer versions of the gcc libraries(someone should be able to give details on this).
Oh, and it's <iostream> not <iostream.h> if you're doing "proper" c++. <iostream.h> is for backwards compability. You'll need to use std::cout because <iostream> resides in namespace std.
Cheers,
T.
[ 23 February 2001: Message edited by: TetsuoII ]
elpresidente
02-23-2001, 11:00 AM
I tried all this yet I still recieve the same error. i thought i had installed all the correct libraries. i guess not. so how do i go about finding/installing the correct ones?
Qubit
02-23-2001, 03:27 PM
Are you by any chance running mandrake? Mandrake seems to have this annoying tendency not to install the standard headers...
elpresidente
02-23-2001, 07:55 PM
As a matter of fact, I am. I even went so far as to go through and individually select which packages to install (after trying all this). Any idea how to find the right headers and install them?
Tyr-7BE
02-23-2001, 11:56 PM
Ah ****...I'm running Drake 7.2 and I had this problem. Can't remember exactly what I did to fix it though. Here's a start: Try running MandrakeUpdate. I know, it's a useless POS, but it's worth a try. Just venturing a guess, but I believe you MIGHT be looking for the glibc files...perhaps not...I'm not sure. I'll tell you this: there's a list of things you need in order to compile from source listed somewhere on the LNO BBS. ****ed if I know where or when it was posted, but it's somewhere on here. If you can find it, go to rpmfind.net and get what you need there. I know it's not much, but hope it helps out a little, cause I know how frustrating compiling things under Mandrake 7.2 can be.
elpresidente
02-24-2001, 07:35 PM
ok..
i found libstdc++-devel and installed it. It seems to compile right but when i try to run it i get:
bash: hello: command not found
any ideas?
Invoke it with ./{program name}, you need to tell your shell to search in the current directory for the executable.
elpresidente
02-25-2001, 01:17 PM
Thank You, thank you, thank you!
It works! Now I can get to the business of learning C++. I appreciate all the help and I'll be sure to check back frequently.