my system is windows, installed Visual Studio 2010 and cmake-3.4.1. I want to use follow commands to generate NMake Makefiles:
SET PATH=D:\Program Files\CMake\bin;D:\Program Files\Microsoft Visual Studio 10.0\VC\bin;D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE
SET LIB=D:\Program Files\Microsoft Visual Studio 10.0\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib
cmake -G"NMake Makefiles" ..
then, error appears:
-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler: D:/Program Files/Microsoft Visual Studio 10.0/VC/bin/cl.exe
-- Check for working C compiler: D:/Program Files/Microsoft Visual Studio 10.0/VC/bin/cl.exe -- broken
CMake Error at D:/Program Files/CMake/share/cmake-3.4/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "D:/Program Files/Microsoft Visual Studio
10.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: F:/codeing/ng/code/eclipse/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_380fe\fast"
"D:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f
CMakeFiles\cmTC_380fe.dir\build.make /nologo -L
CMakeFiles\cmTC_380fe.dir\build
Building C object CMakeFiles/cmTC_380fe.dir/testCCompiler.c.obj
D:\PROGRA~1\MICROS~1.0\VC\bin\cl.exe
@C:\Users\ADMINI~1\AppData\Local\Temp\nm7733.tmp
testCCompiler.c
Linking C executable cmTC_380fe.exe
"D:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe
--intdir=CMakeFiles\cmTC_380fe.dir --manifests --
D:\PROGRA~1\MICROS~1.0\VC\bin\link.exe /nologo
@CMakeFiles\cmTC_380fe.dir\objects1.rsp
@C:\Users\ADMINI~1\AppData\Local\Temp\nm787C.tmp
鍙傛暟閿欒銆俁C Pass 1 failed to run.
NMAKE : fatal error U1077: “"D:\Program Files\CMake\bin\cmake.exe"”:
返回代码“0xffffffff”
Stop.
NMAKE : fatal error U1077: “"D:\Program Files\Microsoft Visual Studio
10.0\VC\bin\nmake.exe"”: 返回代码“0x2”
Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (PROJECT)
-- Configuring incomplete, errors occurred!
See also "F:/codeing/ng/code/eclipse/CMakeFiles/CMakeOutput.log".
See also "F:/codeing/ng/code/eclipse/CMakeFiles/CMakeError.log".
I check file CMakeError.log , contents as follow:
Determining if the C compiler works failed with the following output:
Change Dir: F:/codeing/ng/code/eclipse/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_380fe\fast"
"D:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f CMakeFiles\cmTC_380fe.dir\build.make /nologo -L CMakeFiles\cmTC_380fe.dir\build
Building C object CMakeFiles/cmTC_380fe.dir/testCCompiler.c.obj
D:\PROGRA~1\MICROS~1.0\VC\bin\cl.exe @C:\Users\ADMINI~1\AppData\Local\Temp\nm7733.tmp
testCCompiler.c
Linking C executable cmTC_380fe.exe
"D:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_380fe.dir --manifests -- D:\PROGRA~1\MICROS~1.0\VC\bin\link.exe /nologo @CMakeFiles\cmTC_380fe.dir\objects1.rsp @C:\Users\ADMINI~1\AppData\Local\Temp\nm787C.tmp
鍙傛暟閿欒銆俁C Pass 1 failed to run.
NMAKE : fatal error U1077: “"D:\Program Files\CMake\bin\cmake.exe"”: 返回代码“0xffffffff”
Stop.
NMAKE : fatal error U1077: “"D:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe"”: 返回代码“0x2”
Stop.
infact, I found that CMakeCCompilerId.exe and CMakeCXXCompilerId.exe were already generated(in..\CMakeFiles\3.4.1\CompilerIdC\ and ..\CMakeFiles\3.4.1\CompilerIdCXX\ directories), why cmake still fail? how to solve this problem?
The parameter is incorrectRC Pass 1 failed to run.
? Like in that question: stackoverflow.com/questions/33816778/…. – Tsyvarev