This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc multiple instances conflict
- From: Claudio Bley <bley at cs dot uni-magdeburg dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 18 Sep 2003 14:05:52 +0200
- Subject: Re: gcc multiple instances conflict
- References: <1063852459.26095.ezmlm@gcc.gnu.org> <20030918023901.13218.qmail@web80706.mail.yahoo.com>
On Wed, Sep 17, 2003 at 07:39:01PM -0700, Vinod Joseph wrote:
> Hi
Hi.
> I have installed gcc 2.95.3 on a redhat 9 which
> already had gcc 3.2.2.
I don't know what your reasons are, but be aware that you can't link a
C++ program compiled with gcc 2.95 to libraries compiled with 3.x.
> i want my application to be built and use make with
> gcc 2.95.3 ONLY
>
> Please can u guide me how to solve this problem.
>
> I have tried alias in bashrc but GNU make and g++
> still used gcc 3.2.2
Aliases are not expanded when the shell is not interactive. So, that
won't work.
If you installed gcc 2.95 into another location than gcc 3.2.2
(e.g. /usr/local/bin) you just need to add this directory before
the directory where gcc 3.x is installed in the PATH variable:
$ export PATH="/usr/local/bin:$PATH"
Alternatively, you can specify which compiler make calls when setting
the CC and CXX variables:
$ make CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++
Of course, that assumes that you used these variables in your Makefile
rules (which virtually every Makefile does).
g++ (3.2.2) always uses gcc 3.2.2. You can't change the behaviour of
that command you just need to call the g++ which came with gcc 2.95.
Read 'man bash' for more information.
HTH
--
Claudio Bley ASCII ribbon campaign (")
Debian GNU/Linux user - against HTML email X
http://www.cs.uni-magdeburg.de/~bley/ & vCards / \