为'gcc'选择'mp-gcc47'失败了

时间:2013-11-11 15:22:58

标签: macos gcc macports

https://stackoverflow.com/a/8372496/747050之后我试图选择与macport一起安装的gcc版本。

$port select --list gcc
Available versions for gcc:
    mp-gcc47
    none (active)

$port select --set gcc mp-gcc47
Selecting 'mp-gcc47' for 'gcc' failed: 
  symlink: /opt/local/etc/select/gcc/current -> mp-gcc47: file already exists

我该怎么办?

1 个答案:

答案 0 :(得分:2)

解决方案非常简单。一个人需要删除上面提到的文件。

$ sudo mv /opt/local/etc/select/gcc/current /opt/local/etc/select/gcc/current_saved
Password:
$ port select --set gcc mp-gcc47
Selecting 'mp-gcc47' for 'gcc' succeeded. 'mp-gcc47' is now active.