CMake的,C编译器无法编译简单的测试程序
问题描述:
我试图编译使用cmake使用MinGW但得到的错误我的项目:CMake的,C编译器无法编译简单的测试程序
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.
问题出在哪里?
答
如果目录名称中有任何空格,就像您在“程序文件”中的那样,有时会出现问题。尝试将sdk复制到另一个没有空格的位置,看看会发生什么
什么是gcc版本? gcc - 版本来获取它。通常会因为旧的gcc版本而发生错误。 –
gcc(MinGW.org GCC-6.3.0-1)6.3.0 –
你可以检查这个,看看是否是这种情况:https://stackoverflow.com/a/38786190/7735711 –