GCC doesn't find the Standard-Library
When I try to compile a C++ programm on my Redhat 8.0 system using the gcc, I always get plenty of errors although I'm quite sure that my program i correct.
It seems to me that the gcc doesn't find the Standard-Library, but I'm really a Linux Newbie. Any help is welcomed & thanx in advance styler. My Program code: Code:
// comment Code:
[root@localhost root]# gcc /home/my_dir/dev/test.cpp -o/home/my_dir/dev/test |
#include <iostream.h>
|
Sorry, but that only gives me an additional "deprecated-warning". Any other suggestions?
Thanx for your help, styler warning: #warning This fi le includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples in clude substituting the <X> header for the <X.h> header for C++ includes, or <sst ream> instead of the deprecated header <strstream.h>. To disable this warning us e -Wno-deprecated. |
Well, I would say that you should
Quote:
|
try the command "g++" instead of "gcc". The linker thinks you are linking a C program. g++ tells it it's a C++ program.
p22 |
wow thanx!
when i use g++ instead gcc i get no errors! unfortunately i still have a problem... all the g++ does is to create a file called "out.a". then i want to run my program by typing "out.a" in the konsole. in return i get an error from the konsole: "bash: a.out: command not found" thanx again for your support, styler :newbie: |
I assume you meant "a.out" for the output file... :) However if you specfied -o option to g++, you should not get an a.out, but the name specified! :confused:
To run the file, assuming you are in the same directory as your file, type "./a.out" (without quotes). If you are in a different directory, replace the dot with the directory that a.out is in. hope this helps... |
Thanks, it did help!
|
Just wanted to say that I have spent hours and hours trying to solve this same problem and after seeing this posting it all works - thank you so much - i was at my wits end!
|
You're all welcome! Glad to be of help! :)
|
thanks to the solution, I had the same problem and it is solved now.
|
Another huge thank you. I also spent several hours trying to figure this out.
Cheers, SunnySky |
All times are GMT -5. The time now is 01:03 PM. |