【发布时间】:2018-03-06 01:52:49
【问题描述】:
我正在尝试使用带有 mingw 的 cmake 编译我的项目,但出现错误:
cmake -G "MinGW Makefiles" ../
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: D:/mingw/bin/gcc.exe
-- Check for working C compiler: D:/mingw/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler "D:/mingw/bin/gcc.exe" is not able to compile a simple test
program.
问题出在哪里?
【问题讨论】:
-
你的 gcc 版本是多少? gcc --version 来获取它。通常该错误是由于旧的 gcc 版本而发生的。
-
gcc (MinGW.org GCC-6.3.0-1) 6.3.0
-
你能检查一下,看看是不是这样:stackoverflow.com/a/38786190/7735711
-
仍然出现同样的错误
-
我最后的希望是:stackoverflow.com/a/25995788/7735711 显然搞砸了 $PATH 也可以实现这个错误。如果没有,我不知道了。