views:

34

answers:

1

Hello,

How to tell to a 'configure' file to compile with a specified version of g++ ?

Thanks.

+3  A: 

In a bash shell you can do something like this:

CC=gcc-2.95 ./configure

There will be similar techniques for other shells but I couldn't help you with the specifics. If your project is C++ the variable you need to define is CXX.

Dan Olson
I don't even know how to call the wished version without configure...I type only g++.
Oodini
Actually, on my system, it was gcc-4.1 for gcc-4.1.2.Thanks.
Oodini
This works, but is discouraged. The recommended way to specify CC is in an argument to configure, not in the environment. In other words, you should do "./configure CC=/path/to/desired/compiler".
William Pursell