【发布时间】:2013-04-10 13:52:01
【问题描述】:
CMake 2.8.10.2 for Windows 只是拒绝使用 Visual Studio 2012(在 Windows 7 下)为我配置项目
CMake 似乎添加了一些 Microsoft 编译器不再支持的设置。 LINK:致命错误 LNK1117:选项“清单:嵌入”中的语法错误
我尝试了一个非常基本的 cmake 文件并得到了相同的结果
cmake_minimum_required (VERSION 2.6)
add_executable(test test.cpp)
有解决办法吗?
输出窗口显示:
The C compiler identification is MSVC 17.0.51106.1
The CXX compiler identification is MSVC 17.0.51106.1
Check for working C compiler using: Visual Studio 11
Check for working C compiler using: Visual Studio 11 -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
11.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/tmp/testCmake/build/CMakeFiles/CMakeTmp
Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec3122367237
Microsoft (R) Microsoft Visual Studio 2012 Version 11.0.51106.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: cmTryCompileExec3122367237, Configuration:
Debug Win32 ------
1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01
for 80x86
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
"CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
/Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec3122367237.dir\Debug\\"
/Fd"C:/tmp/testCmake/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec3122367237.pdb"
/Gd /TC /analyze- /errorReport:prompt /Zm1000 testCCompiler.c
1>
1> testCCompiler.c
1>LINK : fatal error LNK1117: syntax error in option 'manifest:embed'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
Configuring incomplete, errors occurred!
【问题讨论】:
-
我在几个项目中使用 VS2012 已经超过 1 个月了。 VTK、ITK、DCMTK、GDCM 和我的代码都构建得很好。我正在使用 CMake 2.8.10.2。虽然我很少再为 32 位构建。
-
我在 Visual Studio 2012 中使用 CMake 已经有一段时间了,没有任何问题。前几天我重新安装了Visual Studio,安装了最新的更新,然后问题就浮出水面了。
-
来自错误消息:找不到cl.exe(VS C++编译器)-您的cl.exe安装在哪里?尝试使用 cl 进行命令行编译(如此处所述:stackoverflow.com/questions/7865432/…)以确定您的编译器是否正常工作。也许你的 VS 安装搞砸了。
-
@Vertexwahn 您的说法不正确。找到编译器,但测试编译失败,出现 jgaa 给出的错误消息。
-
它声明
Check for working C compiler using: Visual Studio 11 -- broken这意味着损坏。如果无法编译简单的测试代码,则认为编译器损坏。我正在使用 2.8.10.2 和 2.8.12.2 并确认 Cmake 和 VS 2012 没有问题。您可以尝试自己编译测试代码作为清单:嵌入本身并没有错。
标签: visual-studio cmake