Linux - SoftwareThis 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.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
[root@localhost root]# gcc /home/my_dir/dev/test.cpp -o/home/my_dir/dev/test
/tmp/ccpQkfQU.o: In function `main':
/tmp/ccpQkfQU.o(.text+0x19): undefined reference to `std::cout'
/tmp/ccpQkfQU.o(.text+0x1e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccpQkfQU.o: In function `__static_initialization_and_destruction_0(int, int)':
/tmp/ccpQkfQU.o(.text+0x4a): undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccpQkfQU.o: In function `__tcf_0':
/tmp/ccpQkfQU.o(.text+0x79): undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccpQkfQU.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
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.
consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>.
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"
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!
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.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.