在 mac 计算机上为 c++ 设置 CLION IDE

Setting up the CLION IDE for c++ on mac computer

我想使用 CLION IDE,我想知道是否需要为我的 mac 计算机下载编译器?

我已阅读此页:https://www.jetbrains.com/help/clion/2016.3/quick-start-guide.html

但我不太清楚是否需要下载一个。 我问这个问题是因为我没有让 Clion 使用我想要的库,我想找出问题所在。

,您确实需要为 CLion 安装编译器才能运行 C++ 或 C 程序它。 Mac书籍或 iMacs 没有预装编译器。

在 Mac 上,您可以通过安装 XCode 获得编译器。当你安装 XCode 时,你也会自动获得必要的命令行工具和默认最新版本的 Clang 编译器,你可以将其与 Clion 一起使用 运行 你的代码。虽然 Apple 提供的 Clang 编译器略有“修改”,但它仍然可以与除XCode之外的任何IDE一起工作.

所以要获得 XCode 你需要做的是:

  • Open a Terminal window on your Mac.
  • Type xcode-select --install in the terminal and hit "ENTER"
  • A dialog will appear telling you that it requires the Command Line Developer Tools, and will ask if you would like to install them. Click on the "Install" button.

要测试 Clang 安装是否成功,请在终端中输入 clang --version 命令。如果它有效,并且显示了 Clang 的版本,那么您已经在 Mac.

上成功安装了它

这将为您提供 Mac 上所有必要的工具,以便您使用 CLion IDE 编译代码。