Di recente ho installato gcc 4.8
usando brew
su OSX 10.7.5 (Lion)
. Ora posso compilare usando gcc 4.8
usando
g++-4.8 some_file.c
o usando il valore predefinito gcc 4.2
usando
g++ some_file.c
Voglio usare gcc 4.8
come compilatore predefinito per Xcode
e se scrivo gcc
al terminale. Suppongo di dover modificare i gcc-related
collegamenti all'interno dirname $(which gcc)
.
Quando io faccio
ls -al $(dirname $(which gcc)) | grep 'gcc\|g++\|c++'
Ottengo quanto segue:
lrwxr-xr-x 1 root wheel 7 Jul 31 12:17 c++ -> clang++
-rwxr-xr-x 1 root wheel 909360 Nov 18 2011 c++filt
lrwxr-xr-x 1 root wheel 5 Jul 31 12:17 clang++ -> clang
lrwxr-xr-x 1 root wheel 12 Jul 31 12:17 g++ -> llvm-g++-4.2
lrwxr-xr-x 1 root wheel 12 Jul 31 12:17 gcc -> llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 28 Jul 31 12:17 gcov-4.2 -> ../llvm-gcc-4.2/bin/gcov-4.2
lrwxr-xr-x 1 root wheel 52 Jul 31 12:17 i686-apple-darwin11-llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-g++-4.2
lrwxr-xr-x 1 root wheel 52 Jul 31 12:17 i686-apple-darwin11-llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-cpp-4.2 -> ../llvm-gcc-4.2/bin/llvm-cpp-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-g++ -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-gcc -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
Quando corro: which gcc-4.8
ottengo /usr/local/bin/gcc-4.8
.
I passaggi per farlo sarebbero molto utili.
Per favore e grazie.
clang 3.3
l'equivalente di gcc 4.8
? Credo di poterlo fare anch'io brew install
.