cmake使用最新的3.9.0有问题,后又试过3.8.2和3.2.0,出现相同错误。话不多说直接上图
errorlog错误信息如下:
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft(R) 生成引擎版本 12.0.21005.1
[Microsoft .NET Framework 版本 4.0.30319.18408]
版权所有 (C) Microsoft Corporation。保留所有权利。
生成启动时间为 2017/7/25 16:33:39。
节点 1 上的项目“E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj”(默认目标)。
PrepareForBuild:
正在创建目录“Debug\”。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(355,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj]
正在创建目录“Debug\CompilerIdCXX.tlog\”。
InitializeBuildStatus:
正在创建“Debug\CompilerIdCXX.tlog\unsuccessfulbuild”,因为已指定“AlwaysCreate”。
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /nologo /W0 /WX- /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /errorReport:queue CMakeCXXCompilerId.cpp
CMakeCXXCompilerId.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj]
已完成生成项目“E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj”(默认目标)的操作 - 失败。
生成失败。
“E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj”(默认目标) (1) ->
(PrepareForBuild 目标) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(355,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj]
“E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj”(默认目标) (1) ->
(Link 目标) ->
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj]
1 个警告
1 个错误
已用时间 00:00:00.23
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft(R) 生成引擎版本 12.0.21005.1
[Microsoft .NET Framework 版本 4.0.30319.18408]
版权所有 (C) Microsoft Corporation。保留所有权利。
生成启动时间为 2017/7/25 16:33:39。
节点 1 上的项目“E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdC\CompilerIdC.vcxproj”(默认目标)。
PrepareForBuild:
正在创建目录“Debug\”。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(355,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdC\CompilerIdC.vcxproj]
正在创建目录“Debug\CompilerIdC.tlog\”。
InitializeBuildStatus:
正在创建“Debug\CompilerIdC.tlog\unsuccessfulbuild”,因为已指定“AlwaysCreate”。
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /nologo /W0 /WX- /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TC /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdC\CompilerIdC.vcxproj]
已完成生成项目“E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdC\CompilerIdC.vcxproj”(默认目标)的操作 - 失败。
生成失败。
“E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdC\CompilerIdC.vcxproj”(默认目标) (1) ->
(PrepareForBuild 目标) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(355,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdC\CompilerIdC.vcxproj]
“E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdC\CompilerIdC.vcxproj”(默认目标) (1) ->
(Link 目标) ->
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [E:\opencv3.0\build\vs2013x64\CMakeFiles\3.2.0-rc1\CompilerIdC\CompilerIdC.vcxproj]
1 个警告
1 个错误
已用时间 00:00:00.18
4 个解决方案
#1
在虚拟机中安装vs2013和Cmake测试,问题依旧
#2
使用最新版的CMake
#3
使用最新版和早期版本都试过了,同样的问题
#4
换vs2013 32位版。
#1
在虚拟机中安装vs2013和Cmake测试,问题依旧
#2
使用最新版的CMake
#3
使用最新版和早期版本都试过了,同样的问题
#4
换vs2013 32位版。