This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Can't install gcc 3.2 alongside gcc 2.96 on Red Hat 7.3
Claudio Bley wrote:
But, I just found out that you may just use 'make DESTDIR=path-to-rootdir
install' as mentioned at http://gcc.gnu.org/install/finalinstall.html to
have it install (temporarily) to a different location.
I did read that bit, but seeing as I wasn't sure what a "temporary
staging area" or "chroot jail" are, or how I could use them, I didn't
try to use DESTDIR.
The include directories are basically the same for both compilers except
for
the libstdc++ headers. You should not have to specify any option to gcc in
order to let it find its specific headers or libraries.
Why is it different for libstdc++ headers?
So gcc 2.96 uses /usr/local/include too? That doesn't seem to be the
case on my computer. How do the compilors tell which are their
(standard) headers and libraries? A file naming convention? I'm just
curious.
Yes, gcc 2.96 should search /usr/local/include too because it's a standard
system include directory. Generally, the /usr/local hierarchy is for use by
the system administrator when installing software locally.
By 'use' I meant does it add files to this directory when installed. :)
I guess it doesn't as I don't see any.
Try 'cat /dev/null | gcc -v -E -':
...]
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i486-linux/3.3.3/include
/usr/include
[...]
What is this doing? What should it tell me? I accidentally messed up the
build I made before I could test it (I will try again tomorrow once the
new build is done), but from the manual I see that it should output "the
commands executed to run the stages of compilation" and "stop after the
preprocessing stage". I guess the trailing '-' means that there are no
input files.
GCC itself does not supply many headers and libraries. Instead it uses the C
standard library of the system and other headers/libraries installed in the
standard locations (/usr/{include,lib} and /usr/local/{include,lib}) by
default.
Hmm. I didn't realise that. This could cause problems as my whole reason
for wanting a more up-to-date version of gcc was that the existing one
couldn't compile the C++ code I am working on. I kept getting error
messages about certain aspects of the standard library not existing (it
works using gcc 3.2 on a Mandrake 8.2 box).
Can I add a more up-to-date version of the standard C++ library to gcc
if I install gcc under my $HOME directory? Which version normally goes
with gcc 3.2.3? Can anyone tell me how I would get my install of gcc to
use this library automatically?
Have a look at http://gcc.gnu.org/install/finalinstall.html which gives a
good overview where the various files are to be installed.
Cheers.
Thanks Claudio!
Jonathan