|
|

楼主 |
发表于 2008-4-14 17:37:05
|
显示全部楼层
我的问题怎么没人管啊?呵呵
你装了另外一个GCC可以参考下面
Using New GCC
If you installed as above, running gcc34 or any other app you installed should be directly accessible. You can verify with the following steps:
[mirandam@charon ~]$ which gcc34
/opt/gcc34/bin/gcc34
[mirandam@charon ~]$ which g++34
/opt/gcc34/bin/g++34
[mirandam@charon ~]$ gcc34 -v
Reading specs from /opt/gcc34/lib/gcc/i686-pc-linux-gnu/3.4.4/specs
Configured with: /home/mirandam/gcc/gcc-3.4.4/configure --prefix=/opt/gcc34
--program-suffix=34 --enable-languages=c,c++ --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
Thread model: posix
gcc version 3.4.4
There are many ways to use an alternate compiler. The 3 methods I commonly use: 1. Environment Variable, 2. Configure Support, and 3. Makefile Support.
Environment Variables
Most softwares support the CC and CXX environment variables. First assign them, then run configure and/or make. Example:
# export CC=gcc34
# export CXX=g++34
# ./configure
Configure Support
If the software is using the standard GNU automake and configure, then there is a chance it supports other compilers by passing in a setting to the configure script. First run configure --help to see if it mentions anything. The following example is from MPlayer:
# ./configure --help
# ./configure --cc=gcc34
Makefile Support
Sometimes the software may just come with a Makefile. Open the Makefile and look inside to see if there are variables that specify the compiler. You can either edit those variables or set them at compile time. For example:
(in Makefile)
C_COMPILER = cc
CPLUSPLUS_COMPILER = c++
Then using the Makefile, you can run:
# make CPLUSPLUS_COMPILER=g++34 |
|