gpt4 book ai didi

xcode - 如何在 mac 的终端中使用 g++?

转载 作者:行者123 更新时间:2023-12-04 03:05:03 24 4
gpt4 key购买 nike

我已经安装了 Xcode,我可以在 Xcode 中编译 .cpp 文件。但是,我想在终端中使用 g++ 但找不到命令:现在是 g++。
我的操作系统是 Mountain Lion Xcode 版本是 4.4。

最佳答案

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

目前确切的软件包是 Command Line Tools (OS X Mountain Lion) for Xcode - 2012 年 9 月

关于苹果包的说明:

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.

关于xcode - 如何在 mac 的终端中使用 g++?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12652701/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com