This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: Exceptions


Chris Prince writes:
>Thanks to Benjamin, I (we) have solved the issue that I was having below. 
>One must be very careful to make sure that when compiling you are using
>the correct compiler.  I apparently had a version of egcs-2.90.66 sitting
>in my /usr/bin directory.  However, in doing a which I believed I was
>using gcc in my /usr/local/bin.  So when I did a command line compile
>everthing worked like a charm, but when I used my Makefile it defaulted to
>/usr/bin thus using the wrong compiler and causing a number of problems.


The basic issue here is multiple-compiler installations and default-compiler
installations.

Red Hat, and most Linux distributions, have gcc and g++ packages,
typically installing with a prefix=/usr (executables in /usr/bin).
However, when you compile a new compiler, configure defaults to /usr/local,
so you end up with a gcc in /usr/local/bin.  

I modified my path to put /usr/local/bin before /usr/bin, and checked all 
the various "cc" and "gcc" executables in my path, plus ran gcc -v
and g++ -v, before compiling. I caught 

Another issue I noticed was that if I su'd to root to compile an SRPM from scratch,
the /usr/bin compiler got used- well, that's because I didn't modify root's PATH
like I did for my user account.  For most things, such as the Linux kernel, that
get compiled as root, the distribution-installed gcc is the most appropriate,
while the /usr/local-installed gcc is an experimental or test compiler.  


The moral of the story is, always make sure that you are calling the compiler
you think you are calling, using the -v flag.

Dave
-----------------------------------------------------------------------------
Email: dek@cgl.ucsf.edu   David Konerding   WWW: http://picasso.ucsf.edu/~dek
-----------------------------------------------------------------------------

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