RE: [newbie] g++ compiler error
Try ./a.out or sh a.out -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Wilbert Ho Sent: Wednesday, November 22, 2000 10:47 PM To: [EMAIL PROTECTED] Subject: [newbie] g++ compiler error Hello. I wrote an elementary C++ program with vi and called it temp.cpp After compiling with g++ temp.cpp I'm presented with the executable a.out (which is as it should be). My problem is, when I try running a.out all I'm getting is bash: Command not found Any ideas?
Re: [newbie] g++ compiler error
On Wed, 22 Nov 2000, Wilbert Ho wrote: Hello. I wrote an elementary C++ program with vi and called it temp.cpp After compiling with g++ temp.cpp I'm presented with the executable a.out (which is as it should be). My problem is, when I try running a.out all I'm getting is bash: Command not found Any ideas? First check if a.out is executable: ls -l a.out It should show a bunch of x's in the permissions. Not there, then do chmod +x a.out And when you want to run it, from the dir where it is: ./a.out Paul -- Not: live and let live But: live and help to live http://nlpagan.net - ICQ 147208 - Registered Linux User 174403 Linux Mandrake 7.2 - Pine 4.30
Re: [newbie] g++ compiler
In a message dated 10/18/2000 6:11:52 PM Eastern Daylight Time, [EMAIL PROTECTED] writes: /* Sample code - Hello World to test g++ */ #include iostream.h int main() { cout "Hello World" endl; return 0; } This fails under a standard, developer installation of LM 7.1. Go figure. I just don't know what they're thinking. Cheers --- Larry Larry, They're thinking desktop (as in Windon't desktop) not hobbiest or programmer. Yet hobbiest is the level needed to configure the system for use (configure cards, X resolution desktop configuration, etc.). -Gary-
Re: [newbie] g++ compiler
[EMAIL PROTECTED] wrote: This fails under a standard, developer installation of LM 7.1. Go figure. I just don't know what they're thinking. They're thinking desktop (as in Windon't desktop) not hobbiest or programmer. Yet hobbiest is the level needed to configure the system for use (configure cards, X resolution desktop configuration, etc.). I suppose you're right Gary but providing a c compiler without printf in the library doesn't make that compiler very useful. This is what they're doing with the c++ compiler. It's like giving you a computer without a keyboard :-) Cheers --- Larry
RE: [newbie] g++ compiler
On Wed, 18 Oct 2000, you wrote: hmm, this compiled and ran fine on my installation of 7.1... what kind of error did you get? And so it should as it's perfectly legitimate (and basic) code. The error is caused by the lack of existence of the iostream library. I'm kinda surprised that you can compile it as I can find no evidence of the standard lib anywhere in the package listings. Can't find iostream.h anywhere. I even reinstalled everything in expert mode, making sure that I had all packages that even remotely were associated with C++ loaded. the rpm you are missing is libstdc++-devel I think that it was on the second cdrom -- Alex (Go easy on me, I'm a COBOL programmer in real life)
Re: [newbie] g++ compiler
/usr/include/g++-2/iostream /usr/include/g++-2/iostream.h /usr/include/g++-2/stdiostream.h /usr/include/g++-3/iostream /usr/include/g++-3/iostream.h /usr/include/g++-3/stdiostream.h Sure makes sense that they should exist there but they don't on my installation. There's no libstdc++ in /usr/include/lib either. I'm really not sure what that means as my current installation (a new install to see if I could fix this as it seemed odd) comes from a late issue of the 7.1 commercial package. Thanks much for at least letting me know they're not supposed to be in some odd place in Linux. Cheers --- Larry
Re: [newbie] g++ compiler
Hrmmm I was going to say all I did was install the developer installation but I do remember selecting packages as well and also installed any rpms that included dev in them =o\ didn't realize they didn't do it by default for a second there I thought I typed something wrong =o) If you go through the expert install it shows you that they do install the c++ compiler by default. That's what's so odd as the blurb associated with it explicitly says that the c++ compiler package doesn't include the ANSI library. I've been told elsewhere that the reason for this is that the ANSI library is maintained separately. Still, you'd think that if they're going to include the compiler they'd include the library. What's even more wierd is that some folks (maybe everyone but me and the few other guys who have asked about it) has them on their system. I'll take another look. Cheers --- Larry
Re: [newbie] g++ compiler
There are 3 or 4 RPM's : egcs-XXX The egcs-c++ contains the header files. I believe that the full set of egcs's has everything for gcc, g++, g77 . Yes it is strange. I setup as "developer". Now, if one is a "developer", presumably one would occasionally be called upon to "develop" some code and maybe even try to compile same. So what are they thinking when the "developer" load doesn't have the appropriate files and doesn't tell you where to find them? Kevin Larry Marshall wrote: Hrmmm I was going to say all I did was install the developer installation but I do remember selecting packages as well and also installed any rpms that included dev in them =o\ didn't realize they didn't do it by default for a second there I thought I typed something wrong =o) If you go through the expert install it shows you that they do install the c++ compiler by default. That's what's so odd as the blurb associated with it explicitly says that the c++ compiler package doesn't include the ANSI library. I've been told elsewhere that the reason for this is that the ANSI library is maintained separately. Still, you'd think that if they're going to include the compiler they'd include the library. What's even more wierd is that some folks (maybe everyone but me and the few other guys who have asked about it) has them on their system. I'll take another look. Cheers --- Larry
Re: [newbie] g++ compiler
Hi all, This is probably a silly question but how do you get the g++ compiler to work ? Im not getting any errors Im just not sure how to use the program. Im going to college in january and would like to get a head start on things. Im using mandrake 7.0. My prefered environment is enlightenment. Thank you, Chronos. Hi Chronos, you can either download som source to a program you would like to compile and weed through the makefile(s) etc ... or just write a simple standard "hello world" program to test the compiler. For more specific information check the "man" pages and the GNU site regarding specifics etc... /* Sample code - Hello World to test g++ */ #include iostream.h int main() { cout "Hello World" endl; return 0; } if you saved this as test.cpp you would compile it by typing .. g++ test.cpp -otest -Lonny
RE: [newbie] g++ compiler
If you want to get a head start, I'd go buy or borrow the book The Linux Programming Bible. http://www.amazon.com/exec/obidos/ASIN/0764546570/o/qid=971903419/sr=8-1/ref =aps_sr_b_1_3/102-4745884-4570511 Although this book is C based (not C++ based), it will give you the particulars about programming in Linux, like how to build makefiles, how to use gdb and the profiler, and how to use CVS... good luck! -Original Message- To: [EMAIL PROTECTED] Subject: Re: [newbie] g++ compiler Hi all, This is probably a silly question but how do you get the g++ compiler to work ? Im not getting any errors Im just not sure how to use the program. Im going to college in january and would like to get a head start on things. Im using mandrake 7.0. My prefered environment is enlightenment. Thank you, Chronos.
Re: [newbie] g++ compiler
This is probably a silly question but how do you get the g++ compiler to work ? Im not getting any errors Im just not sure how to use the program. You execute "g++ great_program.cpp" from the commandline. For any programming project other than something trivial, though, you'll likely call it from a makefile. "How do you use make", you ask. I recommend that you get a basic book on C++ programming and it'll discuss some of this stuff. The specifics of GNU make can be had either via web site descriptions, the OReilly Press book on using GNU tools or by digging through the man pages on these tools. You can call all this stuff from tools like emacs as well Im going to college in january and would like to get a head start on things. Im using mandrake 7.0. My prefered environment is enlightenment. Then start reading and compiling some of the examples. Cheers --- Larry
Re: [newbie] g++ compiler
/* Sample code - Hello World to test g++ */ #include iostream.h int main() { cout "Hello World" endl; return 0; } This fails under a standard, developer installation of LM 7.1. Go figure. I just don't know what they're thinking. Cheers --- Larry
RE: [newbie] g++ compiler
Other good references are the newsgroups: comp.os.unix.programmer newsgroup and comp.os.lang.c++ -Original Message- From: Larry Marshall [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 18, 2000 4:50 PM To: [EMAIL PROTECTED] Subject: Re: [newbie] g++ compiler This is probably a silly question but how do you get the g++ compiler to work ? Im not getting any errors Im just not sure how to use the program. You execute "g++ great_program.cpp" from the commandline. For any programming project other than something trivial, though, you'll likely call it from a makefile. "How do you use make", you ask. I recommend that you get a basic book on C++ programming and it'll discuss some of this stuff. The specifics of GNU make can be had either via web site descriptions, the OReilly Press book on using GNU tools or by digging through the man pages on these tools. You can call all this stuff from tools like emacs as well Im going to college in january and would like to get a head start on things. Im using mandrake 7.0. My prefered environment is enlightenment. Then start reading and compiling some of the examples. Cheers --- Larry
Re: [newbie] g++ compiler
Larry Marshall wrote: hmm, this compiled and ran fine on my installation of 7.1... what kind of error did you get? And so it should as it's perfectly legitimate (and basic) code. The error is caused by the lack of existence of the iostream library. I'm kinda surprised that you can compile it as I can find no evidence of the standard lib anywhere in the package listings. Can't find iostream.h anywhere. I even reinstalled everything in expert mode, making sure that I had all packages that even remotely were associated with C++ loaded. Can you tell me where iostream.h is on your system? I dont need a hello world program but I need it to compile two different programs. Cheers --- Larry /usr/include/g++-2/iostream /usr/include/g++-2/iostream.h /usr/include/g++-2/stdiostream.h /usr/include/g++-3/iostream /usr/include/g++-3/iostream.h /usr/include/g++-3/stdiostream.h Cheers -- ICQ# 89345394 Mailto: [EMAIL PROTECTED] "The number of UNIX installations has grown to 10, with more expected" (The UNIX Programmer's Manual, 2nd Edition, June 1972.)