CMake,configue出错,以下是错误信息。怎么弄? vs2010的。
弹出框“Errorinconfigurationprocess,projectfilesmaybeinvalid”TheCXXcompileridentification...
弹出框“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
CMake Error at 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! 展开
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
CMake Error at 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! 展开
4个回答
展开全部
CMake,configue出错,弹出框“Error in configuration process,project files may be invalid”是设置错误造成的,解决方法如下:
1、首先编写如下所示的main.cpp。
2、新建CMakeLists.txt文件,文件内部声明cmake的最低要求版本,项目名称,以及指定生成的目标。
3、最后同一个目录的文件有两个,即CMakeLists.txt和main.cpp。
4、然后直接在线安装cmake, 命令行上直接执行brew install cmake (这里是在mac系统上的终端执行的)。
5、成功安装完成cmake之后,终端执行命令cmake . 来生成makefile文件(这里没有指定平台,则默认是linux)。
6、最后终端执行make命令生成可执行程序,然后运行可执行程序,从下图的运行结果看,可执行程序运行成功。
展开全部
您好,你的问题我也碰到了,我解决了。你要会读C语言的错误,其实就是看这条(fatal error)
>LINK : fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt
你把这个复制,然后粘贴到网上找就能很容易找到的。
其实就是把E:\Program Files\Microsoft Visual Studio 10.0\VC\bin里的cvtres.exe删除就好了。(这里我的vs2010安装在 E盘Program Files里,所以。。。。。)
>LINK : fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt
你把这个复制,然后粘贴到网上找就能很容易找到的。
其实就是把E:\Program Files\Microsoft Visual Studio 10.0\VC\bin里的cvtres.exe删除就好了。(这里我的vs2010安装在 E盘Program Files里,所以。。。。。)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我使用opencv 2.1 VS2008,这是没有必要根据CMake的,当我用cmake的安装OPENCV 2.0,没有遇到这个问题。现在,我想在Linux中,cmake的opencv2.1下面已经两个星期了,也一直是个问题。
发现这一点,你想帮助, http://www.opencv.org.cn/forum/viewtopic.php?f=1&t=10070
之前你已经看到了这一点吗?
我希望你尽快解决问题。问题或探讨,呵呵
发现这一点,你想帮助, http://www.opencv.org.cn/forum/viewtopic.php?f=1&t=10070
之前你已经看到了这一点吗?
我希望你尽快解决问题。问题或探讨,呵呵
追问
我也觉得没必要装CMake……我的opencv 2.4.4已经能在vs2010上运行了,但在Qt creator里面运行不了,总是找不到头文件,不知道是不是因为没装CMake……本人菜鸟中的菜鸟,望大哥不吝赐教!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
是这样的,目录要选到source里面去
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询