我想在Windows 7上使用cmake生成一个C++项目。在它实际上使项目尽管它看起来cmake做了一个工具链(我使用MinGW)的快速测试,这就是我的问题。 Cmake触发一个make构建,最终失败并显示响应“系统找不到指定的路径”。MinGW使投掷“系统找不到指定的路径。”错误
我跑了在运行模式(N)失败,手动执行的所有命令的具体生成文件:
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML\CMakeFiles\CMakeTmp\CMakeFiles 1
echo Building C object CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj
C:\PROGRA~2\CODEBL~1\MinGW\bin\gcc.exe -o CMakeFiles\cmTryCompileExec306416588.dir\testCCompiler.c.obj -c C:\SFML\CMakeFiles\ CMakeTmp\testCCompiler.c
echo Linking C executable cmTryCompileExec306416588.exe
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTryCompileExec306416588.dir\link.txt --verbose=1
他们都没有错误留下我一个功能.exe文件按预期执行。然而,当通过化妆跑我返回错误:
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML\CMakeFiles\CMakeTmp\CMakeFiles 1
The system cannot find the path specified.
mingw32-make.exe: *** [CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj] Error 1
然后我用简单的东西,如“目录”替换所有命令的实验,发现当通过化妆跑回到“系统cannort找不到指定的路径“再次打印出目录信息并退出时出现错误。
我的下一步,就我所知,是用-d标志运行make;有趣的位为:
Creating temporary batch file C:\Users\CJ\AppData\Local\Temp\make8664-1.bat
Batch file contents:
@echo off
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML\CMakeFiles\CMakeTmp\CMakeFiles 1
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML\CMakeFiles\CMakeTmp\CMakeFiles 1
CreateProcess(C:\Users\CJ\AppData\Local\Temp\make8664 1.bat,C:\Users\CJ\AppData\Local\Temp\make8664-1.bat,...)
Putting child 00490378 (CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj) PID 4730176 on the chain.
Live child 00490378 (CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj) PID 4730176
Main thread handle = 00000074
The system cannot find the path specified.
Reaping losing child 00490378 PID 4730176
Cleaning up temp batch file C:\Users\CJ\AppData\Local\Temp\make8664-1.bat
mingw32-make.exe: *** [CMakeFiles/cmTryCompileExec306416588.dir/testCCompiler.c.obj] Error 1
我真的不知道太多关于化妆的内部运作,但是从我可以从这个输出它看起来像它有事情做与临时批处理文件,使告诉正在做。我看着这个stackoverflow post What causes GNU Make to shell out,它看起来像触发一个临时文件是非常模糊的。我能够找到一个没有创建临时批处理文件(从Windows Git bin中的“ls”)执行的命令,并且确实已经通过make执行了,而不会返回“系统找不到指定的路径”响应,如“目录“命令did(”dir“导致生成该临时文件)。
我觉得我用我的调试能力打了一堵墙,现在转向你们,看看你们能否提供任何建议。这似乎是我做出正确的假设?你有没有洞察什么可能表明这个问题?
我曾经有一个类似的问题,原因是我的防病毒,你可以看到如果你想暂时禁用它。 – Antonio 2015-04-04 21:01:59
@Antonio:我有同样的问题 - 请参阅[这个问题和答案](https://stackoverflow.com/q/43378159/428857)。 – TonyK 2017-06-11 12:17:13