如何在Mac终端中使用g ++? [英] How to use g++ in terminal in mac?

查看:176
本文介绍了如何在Mac终端中使用g ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Xcode,我可以在Xcode中编译.cpp文件。但是,我想在终端中使用g ++,但没有找到命令:g ++ now。

我的操作系统是Mountain Lion Xcode版本是4.4。 解决方案

你需要下载并安装来自 Apple Developer 的OSX Mountain Lion的命令行工具(您需要一个Apple ID是免费注册的)。这将安装GCC(包括g ++),以便您可以从终端直接构建

目前确切的软件包是用于Xcode的命令行工具(OS X Mountain Lion) - 2012年9月



Apple的软件包描述: b
$ b


这个软件包支持UNIX风格的开发通过终端安装命令行开发工具,以及Mac OS X SDK框架和头文件。包括许多有用的工具,如Apple LLVM编译器,链接器和Make。如果您使用Xcode,这些工具也嵌入在Xcode IDE中,并且可以使用Xcode 4.5中的下载偏好设置面板安装在您的系统中。



I've installed Xcode and I can compile .cpp files in Xcode. However, I wanna use g++ in Terminal but command not found: g++ now.
My OS is Mountain Lion Xcode version is 4.4.

解决方案

You need to download and install the Command Line Tools for OSX Mountain Lion from Apple Developer (you'll need a Apple ID which is free to sign up for). This will install GCC (including g++) so you can build direct from Terminal

The exact package currently is Command Line Tools (OS X Mountain Lion) for Xcode - September 2012

Description about the package from Apple:

This package enables UNIX-style development via Terminal by installing command line developer tools, as well as Mac OS X SDK frameworks and headers. Many useful tools are included, such as the Apple LLVM compiler, linker, and Make. If you use Xcode, these tools are also embedded within the Xcode IDE, and can be installed on your system using the Downloads preferences pane within Xcode 4.5.

这篇关于如何在Mac终端中使用g ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆