Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 在OS X上安装GCC 4.7.1_Macos_Shell_Gcc_Installation_Gnu - Fatal编程技术网

Macos 在OS X上安装GCC 4.7.1

Macos 在OS X上安装GCC 4.7.1,macos,shell,gcc,installation,gnu,Macos,Shell,Gcc,Installation,Gnu,我正试图在Mac上安装GCC4.7.1,因为我想更新XCode中给出的LLVM GCC4.2 我已经下载了GCC4.7.1,并将GCC-4.7.1文件夹放在~/Downloads中,然后我按照这里给出的说明进行了操作:我写了 cd ~/Desktop mkdir objdir cd objdir ~/Downloads/gcc-4.7.1/configure --with-gmp=/usr/local/include --with-mpfr=/usr/local/include --with-m

我正试图在Mac上安装
GCC
4.7.1,因为我想更新XCode中给出的
LLVM GCC
4.2

我已经下载了
GCC
4.7.1,并将
GCC-4.7.1
文件夹放在
~/Downloads
中,然后我按照这里给出的说明进行了操作:我写了

cd ~/Desktop
mkdir objdir
cd objdir
~/Downloads/gcc-4.7.1/configure --with-gmp=/usr/local/include --with-mpfr=/usr/local/include --with-mpc=/usr/local/include
配置确实显示出问题

然后我写了

make
在我得到这个信息之前一切都很顺利

rm -f stage_current
Comparing stages 2 and 3
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
  Bootstrap comparison failure!
gcc/intl.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2
make: *** [all] Error 2
/bin/sh: line 0: cd: ./fixincludes: No such file or directory
make[1]: *** [check-fixincludes] Error 1
make: *** [do-check] Error 2
然后,
makecheck
给我这个消息

rm -f stage_current
Comparing stages 2 and 3
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
  Bootstrap comparison failure!
gcc/intl.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2
make: *** [all] Error 2
/bin/sh: line 0: cd: ./fixincludes: No such file or directory
make[1]: *** [check-fixincludes] Error 1
make: *** [do-check] Error 2
以及
makeinstall
此消息

/bin/sh /Users/fpiro07/Downloads/gcc-4.7.1/mkinstalldirs /usr/local /usr/local
/bin/sh: line 0: cd: ./fixincludes: No such file or directory
make[1]: *** [install-fixincludes] Error 1
make: *** [install] Error 2
如何解决这些问题并安装我的
GCC
4.7.1?

安装并运行:


它将负责正确配置和安装gcc(编写本文时为4.7.2)和所有依赖项。

不起作用。我已经下载了.pkg文件并通过双击安装了它。之后,我在我的终端中输入了‘sudo-port-selfupdate’,上面写着‘sudo:port:command-not-found’。好的,所以你需要在安装macports后重新启动终端!但它仍然不起作用,因为当我进入g++--版本时,我看到我仍然处于版本4.2.1!您需要检查
/opt/local/bin
是否位于
$PATH
中。有关详细信息,请查看macports文档。