Eu instalei recentemente gcc 4.8
usando brew
on OSX 10.7.5 (Lion)
. Agora posso compilar usando gcc 4.8
usando
g++-4.8 some_file.c
ou usando o padrão gcc 4.2
usando
g++ some_file.c
Eu quero usar gcc 4.8
como o compilador padrão para Xcode
e se eu digitar gcc
no terminal. Suponho que devo alterar os gcc-related
links internos dirname $(which gcc)
.
Quando eu faço
ls -al $(dirname $(which gcc)) | grep 'gcc\|g++\|c++'
Eu recebo o seguinte:
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 eu corro: which gcc-4.8
eu entendo /usr/local/bin/gcc-4.8
.
Passos para fazer isso seriam muito úteis.
Por favor e obrigado.
clang 3.3
o equivalente a gcc 4.8
? Eu acredito que posso brew install
também.