2014-09-04 56 views
0

我在使用brew安装valgrind时遇到了一些麻烦。我使用的命令:用brew安装valgrind和/或gdb?

brew install valgrind 

,并得到错误

==> ./configure --prefix=/usr/local/Cellar/valgrind/3.9.0 --enable-only64bit -- build=amd64-darwin 
checking for gcc... gcc-4.2 
checking whether the C compiler works... no 
configure: error: in `/private/tmp/valgrind-bA4juk/valgrind-3.9.0': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting 

我得到使用gdb

==> Downloading http://ftpmirror.gnu.org/gdb/gdb-7.7.1.tar.gz 
Already downloaded: /Library/Caches/Homebrew/gdb-7.7.1.tar.gz 
==> ./configure --prefix=/usr/local/Cellar/gdb/7.7.1 --with-system-readline --with-python=/usr 
checking for gcc... gcc-4.2 
checking for C compiler default output file name... 
configure: error: in `/private/tmp/gdb-6Ivx9u/gdb-7.7.1': 
configure: error: C compiler cannot create executables 
See `config.log' for more details. 

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting 
If reporting this issue please do so at (not Homebrew/homebrew): 
    https://github.com/homebrew/homebrew-dupes/issues 

类似的错误但是C编译器是

$ cc -v 
Using built-in specs. 
COLLECT_GCC=cc 
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc49/4.9.0/libexec/gcc/x86_64-apple-darwin13.3.0/4.9.0/lto-wrapper 
Target: x86_64-apple-darwin13.3.0 
Configured with: ../configure --build=x86_64-apple-darwin13.3.0 --prefix=/usr/local/Cellar/gcc49/4.9.0 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.9 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc49 4.9.0' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib 
Thread model: posix 
gcc version 4.9.0 (Homebrew gcc49 4.9.0) 

有谁知道可能是什么出错了?我在OS X 10.9.4上。

回答

1
checking for gcc... gcc-4.2 
gcc version 4.9.0 (Homebrew gcc49 4.9.0) 

来自brew和手动运行的输出显示了2个独立版本的gcc,并且brew正在拾取真正的旧版本。设置您的环境,以便which gcc返回4.9版本。

+0

当我输入 '这gcc' 我得到 '在/ usr/bin中/ gcc' 当我键入'GCC -v'我得到 'gcc版本4.9.0(家酿gcc49 4.9.0)' 你是这个意思吗?我错过了什么吗? – 2014-09-04 21:40:53

+0

看来,自制软件正在使用gcc 4.2找到某处。你有什么版本的酿造?你有没有安装gcc 4.2的地方? – ventsyv 2014-09-04 22:03:31

+0

我正在使用brew 0.9.5,并且我认为brew安装gcc 4.2时,我已经'brew install gcc',但我不知道如何删除它... – 2014-09-04 22:41:24

0

答案就在这里

Using Homebrew with GCC-4.6

我通过安装

HOMEBREW_CC=gcc-4.9 HOMEBREW_CXX=g++-4.9 brew install gdb

HOMEBREW_CC=gcc-4.9 HOMEBREW_CXX=g++-4.9 brew install valgrind

0

你应该b解决了这个问题使用brew:brew install -HEAD valgrind可以执行以下命令来安装valgrind:在最糟糕的情况下,您可能需要先执行以下这些设置命令:HOMEBREW_CC = gcc-4.5 brew