【发布时间】:2018-03-10 07:59:12
【问题描述】:
我正在使用一个非常不方便的软件,它不支持 clang。所以,我需要更改我的 cmake 编译器,因为我几乎在所有地方都阅读过,在这里How can I make CMake use GCC instead of Clang on Mac OS X?,我尝试了:
cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++
但是,我仍然收到此错误
CMake Error at CMakeLists.txt:59 (message):
GAMBIT does not support the Clang compiler. Please choose another
compiler.
-- Configuring incomplete, errors occurred!
有什么建议吗?
【问题讨论】:
-
使用
cmake-gui并在那里更改设置? -
尝试在 CMakeLists.txt 文件中设置 C 和 C++ 编译器:SET(CMAKE_C_COMPILER /path/to/c/compiler) SET(CMAKE_CXX_COMPILER /path/to/cpp/compiler)
-
检查你是否安装了 real gcc。 AFAIR Xcode 不再提供 gcc,运行
gcc会调用clang。 -
g++ --version应该消除任何混淆。 -
我有两个 g++ 一个 /usr/bin/g++ 是 clang 的符号链接,另一个是 /opt/local/bin/g++ 这是我安装的 g++!
标签: c++ macos gcc compiler-errors cmake