在Cygwin上安装GCC-4.7.2失败

时间:2013-01-14 15:02:14

标签: gcc g++ makefile cygwin gcc4.7

因为Cygwin中的默认GCC是4.5.3,所以我尝试安装GCC 4.7.2。我从here下载了tar.bz存档,将其放到cygwin\usr\gcc-4.7.2并按以下顺序执行:

tar xvf gcc-4.7.2.tar.bz2
cd gcc-4.7.2
./contrib/download_prerequisites
mkdir build
cd build
../configure --build=x86_64-linux-gnu --prefix=/usr/gcc-4.7.2 --enable-checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-4.7
make
sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
sudo make install

我坚持make并出现以下错误:(超过一小时后)

make[3]: Leaving directory `/usr/gcc-4.7.2/build/gcc'
mkdir -p -- x86_64-linux-gnu/libgcc
Checking multilib configuration for libgcc...
Configuring stage 1 in x86_64-linux-gnu/libgcc
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for x86_64-linux-gnu-ar... ar
checking for x86_64-linux-gnu-lipo... lipo
checking for x86_64-linux-gnu-nm... /usr/gcc-4.7.2/build/./gcc/nm
checking for x86_64-linux-gnu-ranlib... ranlib
checking for x86_64-linux-gnu-strip... strip
checking whether ln -s works... yes
checking for x86_64-linux-gnu-gcc... /usr/gcc-4.7.2/build/./gcc/xgcc -B/usr/gcc-4.7.2/build/./gcc/ -B/usr/gcc-4.7.2/x86_64-linux-gnu/bin/ -B/usr/gcc-4.7.2/x86_64-linux-gnu/lib/ -isystem /usr/gcc-4.7.2/x86_64-linux-gnu/include -isystem /usr/gcc-4.7.2/x86_64-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/usr/gcc-4.7.2/build/x86_64-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Makefile:15654: recipe for target `configure-stage1-target-libgcc' failed
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/usr/gcc-4.7.2/build'
Makefile:19334: recipe for target `stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/usr/gcc-4.7.2/build'
Makefile:903: recipe for target `all' failed
make: *** [all] Error 2

此日志是否包含enoung信息,说明出了什么问题?

完整的日志要大得多,所以我允许自己只放置他的一部分。我在Pastebin上找到的指令:http://pastebin.com/1MBaAikB

有人能给我一个提示我怎么能解决这个问题?

编辑1: 我试图以其他方式实现它。我在http://matpack.de/cygwin/index.html

上找到了安装说明
tar -xf gcc-4.7.2.tar.bz2
mkdir gcc-build
cd gcc-build
../gcc-4.7.2/configure --enable-languages=c,c++
make -j 4
make install
make clean          (OPTIONAL)
cd ..

我得到的错误现在与“权限已被拒绝”相关联。错误日志:http://pastebin.com/0stdpFKf

这怎么可能?

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。我已经将mpc,mpfr和gmp库的库路径导出到LD_LIBRARY_PATH环境变量,然后它正在工作。

答案 1 :(得分:0)

GCC 4.7.2现已作为测试版发布。在setup.exe中,切换所有gcc4-*个包的版本号,以及libgcc1libstdc++6等,直到显示4.7版本。请记住,在Keep的后续运行期间,您必须再次选择setup.exe这些,直到它们被宣布为稳定为止。