This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

which g++ ?



Takuya Kobayashi writes:
 > 	g++ main.cpp -o main
 > 
 > Which "g++" am I invoking?  Does one override the other?  It seems like
 > a stupid question, but nevertheless I needed to know, so....

Your question isn't stupid, just asked in the wrong forum.  Your question
has more to do with how Unix works, or more specifically how the typical
Unix command line shell works.  I'd strongly recommend a good book on 
Unix (or perhaps there's something online these days).

It is likely that your using Bash as your shell.  If so, you can 
find the answer to your question in the Bash man page, 
type "man bash", under the section entitled "COMMAND EXECUTION",
particularly the use of the PATH shell variable.  Also, if you
are running Bash, the command "type g++" will tell you where
g++ is found.  If you are not running Bash, the above may help
anyway, this behavior is very standard across all unix shells.

Finally, like most GNU tools, g++ supports the --version option:

     g++ --version

will print out the version of g++ that gets run.  If you know the
version of g++ that comes with your version of RedHat, and the
version of g++ that you installed, you can use this to tell what's
actually getting run.

Good luck.

                                           -gavin...



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]