Ich versuche, gcc47 als meinen Standardcompiler mit Homebrew zu installieren. Ich kann gcc47 erfolgreich installieren, aber es fügt ein -4.7-Suffix für alle seine Binärdateien hinzu. Wenn ich versuche, es in / usr / local / bin zu verknüpfen, wird es schwierig. Bedenken Sie:
$ which gcc
/usr/bin/gcc
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ ln -s /usr/local/bin/gcc-4.7 /usr/local/bin/gcc
$ which gcc
/usr/local/bin/gcc
$ gcc --version
gcc-4.7: err or trying to exec '/usr/local/bin/../Cellar/gcc47/4.7.2/bin/i686-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
$ ls -l /usr/local/bin/*gcc* /usr/local/bin/*g++*
lrwxr-xr-x 1 mike staff 33 Mar 27 15:48 /usr/local/bin/g++-4.7 -> ../Cellar/gcc47/4.7.2/bin/g++-4.7
lrwxr-xr-x 1 mike staff 22 Mar 28 11:32 /usr/local/bin/gcc -> /usr/local/bin/gcc-4.7
lrwxr-xr-x 1 mike staff 33 Mar 27 15:48 /usr/local/bin/gcc-4.7 -> ../Cellar/gcc47/4.7.2/bin/gcc-4.7
lrwxr-xr-x 1 mike staff 36 Mar 27 15:48 /usr/local/bin/gcc-ar-4.7 -> ../Cellar/gcc47/4.7.2/bin/gcc-ar-4.7
lrwxr-xr-x 1 mike staff 36 Mar 27 15:48 /usr/local/bin/gcc-nm-4.7 -> ../Cellar/gcc47/4.7.2/bin/gcc-nm-4.7
lrwxr-xr-x 1 mike staff 40 Mar 27 15:48 /usr/local/bin/gcc-ranlib-4.7 -> ../Cellar/gcc47/4.7.2/bin/gcc-ranlib-4.7
lrwxr-xr-x 1 mike staff 59 Mar 27 15:48 /usr/local/bin/x86_64-apple-darwin12.3.0-g++-4.7 -> ../Cellar/gcc47/4.7.2/bin/x86_64-apple-darwin12.3.0-g++-4.7
lrwxr-xr-x 1 mike staff 59 Mar 27 15:48 /usr/local/bin/x86_64-apple-darwin12.3.0-gcc-4.7 -> ../Cellar/gcc47/4.7.2/bin/x86_64-apple-darwin12.3.0-gcc-4.7
lrwxr-xr-x 1 mike staff 61 Mar 27 15:48 /usr/local/bin/x86_64-apple-darwin12.3.0-gcc-4.7.2 -> ../Cellar/gcc47/4.7.2/bin/x86_64-apple-darwin12.3.0-gcc-4.7.2
lrwxr-xr-x 1 mike staff 62 Mar 27 15:48 /usr/local/bin/x86_64-apple-darwin12.3.0-gcc-ar-4.7 -> ../Cellar/gcc47/4.7.2/bin/x86_64-apple-darwin12.3.0-gcc-ar-4.7
lrwxr-xr-x 1 mike staff 62 Mar 27 15:48 /usr/local/bin/x86_64-apple-darwin12.3.0-gcc-nm-4.7 -> ../Cellar/gcc47/4.7.2/bin/x86_64-apple-darwin12.3.0-gcc-nm-4.7
lrwxr-xr-x 1 mike staff 66 Mar 27 15:48 /usr/local/bin/x86_64-apple-darwin12.3.0-gcc-ranlib-4.7 -> ../Cellar/gcc47/4.7.2/bin/x86_64-apple-darwin12.3.0-gcc-ranlib-4.7