在 macOS 中使用 g++ 编译 cpp 文件。
macOS v10.15.4
Apple clang 版本 11.0.3 (clang-1103.0.32.62)
你好.cpp
#include <iostream> using namespace std; int main() { cout << "hello word" << endl; return 0; }
in terminal
g++ hell.cpp
最佳答案
CPLUS_INCLUDE_PATH
环境变量的值不正确。
简单的修复:
export CPLUS_INCLUDE_PATH=":/usr/local/include"
关于c++ -/usr/bin/locale : source file is not valid UTF-8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62617618/