This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC Version
"Samuel T. Santos" <soujavatambem at uol dot com dot br> writes:
[snip]
> > What does /usr/local/bin/gcc -v show?
>
> the same above when you tell that gcc is 3.2 and -1 is mandrake package
> version and so on...
Are sure? (0) If so, I am confused - or you have 3.2 installed twice, in
two different places, the second place conflicting with 3.2.2 -
which is bad.
Note:
(0) Don't test this using
$cd /usr/local/bin/
$gcc -v
because if . isn't the first thing in your path, you'll still be
testing /usr/bin/gcc . Test with:
$/usr/local/bin/gcc
(Note: If you don't know, the initial $ represents your prompt;
don't type it, type the remainder at your prompt.)
> >
> > Mandrake (and most other linux distros) slices and dices gcc into
> > several packages. If you just hit the checkbox for gcc (on install),
> > you don't get g++.
> >
>
> but when I download 3.2.2 I downloaded all and compile...
> then... gcc 3.2.2 for C its installed in differente place of the
> mandrake version
Yes. Mandrake installs its gcc in /usr (at least they
always have in the past; I don't have 9.0, just 8.2)
However the source tarball installs into /usr/local by default.
> what is the gcc 3.2?
I'm guessing the gcc 3.2 is the one that came with your linux distro
(mandrake).
>
> > I suspect you have gcc 3.2.2 installed under /usr/local, with support
> > for all languages, etc that are on by default, and gcc 3.2
> > installed (by your linux distro) in /usr, with only the C
> > frontend. Further, I guess /usr/bin comes before /usr/local/bin in
> > your path. So typing 'gcc' results in /usr/bin/gcc, while 'g++'
> > results in /usr/local/bin/g++, because you have no /usr/bin/g++.
> >
> > [snip]
>
> how I modify for that I hae just one compile, the new version?
(a) Put /usr/local/bin first in your path. If your shell is bash, sh,
or ksh:
$export PATH=/usr/local/bin:$PATH
does the trick. You might want it in your .bashrc if you use it
all the time.
This causes /usr/local/bin to be searched for commands before
/usr/bin (or anything else). It's possilbe, but not common, to
have other name-alike commands which occur in both /usr/bin and
/usr/local/bin - note that these other commands will also be found
in /usr/local/bin .
(b) Just type out the full path of the compiler you want -
/usr/local/bin/gcc, for example. With command line editing, I
don't find this too onerous; I use it all the time.
[snip]