visual studio2010问题导致CMake执行例子时出错Error in configuration process,project files may be invalid

visual studio2010问题导致CMake执行例子时出错Error in configuration process,project files may be invalid_第1张图片visual studio2010问题导致CMake执行例子时出错Error in configuration process,project files may be invalid_第2张图片

详细错误:

弹出框“Error in configuration process,project files may be invalid”
The CXX compiler identification is unknown
The C compiler identification is MSVC 16.0.30319.1
Check for working C compiler using: Visual Studio 10
Check for working C compiler using: Visual Studio 10 -- broken
CMakeErrorat D:/OpenCV/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "D:/vs2010 setup/VC/bin/cl.exe" is not able to compile a
simple test program.
It fails with the following output:
Change Dir: D:/OpenCV/binaries/CMakeFiles/CMakeTmp
Run Build Command:D:\VS2010~1\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln
/build Debug /project cmTryCompileExec3397238485
Microsoft (R) Visual Studio Version 10.0.30319.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: cmTryCompileExec3397238485, Configuration:
Debug Win32 ------
1>Build started 2013/3/11 14:15:57.
1>PrepareForBuild:
1> Creating directory "D:\OpenCV\binaries\CMakeFiles\CMakeTmp\Debug\".
1>InitializeBuildStatus:
1> Creating
"cmTryCompileExec3397238485.dir\Debug\cmTryCompileExec3397238485.unsuccessfulbuild"
because "AlwaysCreate" was specified.
1>ClCompile:
1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.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"cmTryCompileExec3397238485.dir\Debug\\"
/Fd"D:/OpenCV/binaries/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec3397238485.pdb"
/Gd /TC /analyze- /errorReport:prompt testCCompiler.c /Zm1000 
1> 
1> testCCompiler.c
1>LINK : fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.16
========== 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):
CMakeLists.txt:61 (project)
Configuring incomplete, errors occurred!

其实主要就是看这条(fatal error)
>LINK : fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt

LINK:fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

解决办法:

查看计算机是否为64bit操作系统,如是,继续如下操作。
查找是否有两个cvtres.exe
C:\Program Files(x86)\Microsoft Visual Studio 10.0\vc\bin\cvtres.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe
右键属性—详细信息, 查看两者版本号,删除/重命名较旧的版本,或者重新设置Path变量。

治本的办法是第二步,删除旧版本的cvtres.exe后,就不需要每次都设置配置了。

http://blog.csdn.net/kevin_mqj/article/details/22981873

https://zhidao.baidu.com/question/531299164.html


你可能感兴趣的:(PCL)