Xcode OSX上的gcc版本
我在我的代码中使用了一些内联函数,gcc.gnu.org说在GCC4.3之前在语义上存在重大差异。我想使用GCC4.4+,但我不知道如何在我的Mac上实现这一点。这是gcc-v的输出:Xcode OSX上的gcc版本,xcode,macos,gcc,Xcode,Macos,Gcc,我在我的代码中使用了一些内联函数,gcc.gnu.org说在GCC4.3之前在语义上存在重大差异。我想使用GCC4.4+,但我不知道如何在我的Mac上实现这一点。这是gcc-v的输出: $ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.1
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
从这里我假设我有GCC4.2.1,对吗?如何获得更新版本?您可以使用自制或macports安装新版本。我相信keg的版本中有gcc。您可以使用安装所需的版本
brew tap homebrew/versions
brew install gcc44
这为我解决了这个问题:
$ brew tap homebrew/versions
$ brew update
$ brew install gcc48
它是
brew
而不是homebrew
。哦,糟糕,这是一个打字错误。我已经使用了homebrew,所以我知道语法。谢谢你的帮助。