首页 > 解决方案 > 将 C++ 编译器从 Ubuntu 更改为 MacOS

问题描述

这个学期我在大学里有 C++ 课程。由于编译的原因,他们要求我们在学期任务中使用 Ubuntu。

我有 Mac 操作系统。我可以将编译器更改为与 Ubuntu 的相同吗?

谢谢。

标签: c++macosubuntuclion

解决方案


I don't have much experience with MacOS, but as far as I'm concerned, when you install XCode it automatically installs g++, which is a compiler you can use on Linux and Windows (with mingw).
Also, if you don't want to install XCode, you can get gcc / g++ through homebrew: https://brew.sh/

Another alternative would be clang / clang++.


推荐阅读