很多人似乎都遇到过这个问题。GNU 网站强烈建议运行
./contrib/download_prerequisites
在源目录中,以避免链接 MPC、MPFR 和 GMP 时出现问题。以下链接包含我遵循的说明:http: //gcc.gnu.org/wiki/InstallingGCC,我在此处列出:
tar xzf gcc-4.8.1.tar.gz
cd gcc-4.8.1
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.1/configure --prefix=$HOME/gcc-4.8.1-install
make
make install
此网址的常见问题解答:http: //gcc.gnu.org/wiki/FAQ#configure_suffix声称只要它们位于 gcc-4.8.1 源的子目录中,编译查找 MPC 相关文件就没有问题目录。跑步
./contrib/downlaod_prerequisites
在正确的位置下载 MPC,但运行 make 后仍然出现此错误:
checking for x86_64-unknown-linux-gnu-gcc... /home/xxxx/gcc-4.8.1-build/./gcc/xgcc -B/home/xxxx/gcc-4.8.1-build/./gcc/ -B/home/xxxx/gcc-4.8.1-install/x86_64-unknown-linux-gnu/bin/ -B/home/xxxx/gcc-4.8.1-install/x86_64-unknown-linux-gnu/lib/ -isystem /home/xxxx/gcc-4.8.1-install/x86_64-unknown-linux-gnu/include -isystem /home/xxxx/gcc-4.8.1-install/x86_64-unknown-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/home/xxxx/gcc-4.8.1-build/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
打开/home/xxxx/gcc-4.8.1-build/x86_64-unknown-linux-gnu/libgcc/config.log显示以下错误:
/home/mgiamou/gcc-4.8.1-build/./gcc/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
GNU 常见问题解答 ( http://gcc.gnu.org/wiki/FAQ#configure_suffix ) 说这个错误是没有正确安装 MPC 的症状。任何帮助将非常感激。