MinGW: A native Windows port of the GNU Compiler Collection (GCC), with freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All of MinGW’s software will execute on the 64bit Windows platforms.
PS D:\Trrrrw\文档\C\test\build> cmake .. -G "MinGW Makefiles"-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: D:/MinGW/bin/gcc.exe
-- Check for working C compiler: D:/MinGW/bin/gcc.exe - broken
CMake Error at D:/Trrrrw/应用/命令行工具/cmake/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"D:/MinGW/bin/gcc.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'D:/Trrrrw/文档/C/test/build/CMakeFiles/CMakeScratch/TryCompile-qihtzh' Run Build Command(s): D:/Trrrrw/应用/命令行工具/cmake/bin/cmake.exe -E env VERBOSE=1 D:/MinGW/bin/mingw32-make.exe -f Makefile cmTC_22fc3/fast
D:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_22fc3.dir\build.make CMakeFiles/cmTC_22fc3.dir/build
mingw32-make.exe[1]: Entering directory 'D:/Trrrrw/文档/C/test/build/CMakeFiles/CMakeScratch/TryCompile-qihtzh' 系统找不到指定的路径。
CMakeFiles\cmTC_22fc3.dir\build.make:76: recipe for target 'CMakeFiles/cmTC_22fc3.dir/testCCompiler.c.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_22fc3.dir/testCCompiler.c.obj] Error 1 mingw32-make.exe[1]: Leaving directory 'D:/Trrrrw/文档/C/test/build/CMakeFiles/CMakeScratch/TryCompile-qihtzh' Makefile:126: recipe for target 'cmTC_22fc3/fast' failed
mingw32-make.exe: *** [cmTC_22fc3/fast] Error 2 CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)-- Configuring incomplete, errors occurred!
解决:
重新安装cmake,使用安装包安装,不要下载压缩包手动添加环境变量
CMake Error: Target DependInfo.cmake file not found
运行:
1
make
输出:
1
2
3
4
5
6
CMake Error: Target DependInfo.cmake file not found
make[2]: *** No rule to make target 'D:/Trrrrw//C/test/main.c', needed by 'CMakeFiles/test.dir/main.c.obj'. Stop.
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/test.dir/all' failed
make[1]: *** [CMakeFiles/test.dir/all] Error 2Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2