如何在MacOS X上安装g ++? [英] How do I install g++ on MacOS X?
问题描述
我想使用g ++编译器在MacOS X上编译C ++代码。如何安装它?
I want to compile C++ code on MacOS X, using the g++ compiler. How do I install it?
推荐答案
这是Apple的XCode工具包附带的编译器。他们已经黑了一点,但基本上只是g ++。
That's the compiler that comes with Apple's XCode tools package. They've hacked on it a little, but basically it's just g++.
你可以免费下载XCode(好吧,大多数情况下,你必须注册成为一个ADC成员,但这是免费的)在这里: http://developer.apple.com/technology/xcode.html
You can download XCode for free (well, mostly, you do have to sign up to become an ADC member, but that's free too) here: http://developer.apple.com/technology/xcode.html
编辑2013-01-25:这个答案在三年前是正确的。我不知道现在是否正确。虽然XCode工具仍然有一个命令行C ++编译器,我相信最近版本的OS X(我认为10.7和更高版本)已切换到 clang / llvm (主要是因为苹果想要开源的所有好处,而不需要贡献回来,ang是BSD许可)。其次,我相信自从苹果开始推广App Store以获得一切之后,获得XCode的程序已经改变。
Edit 2013-01-25: This answer was correct three years ago. I'm not so sure it's correct now. While XCode tools still has a command-line C++ compiler, I believe recent versions of OS X (I think 10.7 and later) have switched to clang/llvm (mostly because Apple wants all the benefits of Open Source without having to contribute back and clang is BSD licensed). Secondly, I believe the procedure for getting XCode has changed since Apple started promoting the App Store as the way to get everything.
这篇关于如何在MacOS X上安装g ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!