用Cmake配置Opencv时,configure不过去 出现erroe如下: 5

CMakeError:Unabletoopencachefileforsave.C:/ProgramFiles/Opencv_VS2010/CMakeCache.txtC... CMake Error: Unable to open cache file for save. C:/Program Files/Opencv_VS2010/CMakeCache.txt
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:160 (FILE):
file Internal CMake error when trying to open file: C:/Program
Files/Opencv_VS2010/CMakeFiles/CMakeOutput.log for writing.
Call Stack (most recent call first):
CMakeLists.txt:56 (project)
CMake Error: Could not open file for write in copy operation C:/Program Files/Opencv_VS2010/CMakeFiles/CMakeSystem.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:172 (CONFIGURE_FILE):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:56 (project)
CMake Error: Could not open file for write in copy operation C:/Program Files/Opencv_VS2010/CMakeFiles/CMakeCCompiler.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:177 (CONFIGURE_FILE):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:56 (project)
CMake Error: Could not find cmake module file:C:/Program Files/Opencv_VS2010/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Could not open file for write in copy operation C:/Program Files/Opencv_VS2010/CMakeFiles/CMakeCXXCompiler.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:182 (CONFIGURE_FILE):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:56 (project)
CMake Error: Could not find cmake module file:C:/Program Files/Opencv_VS2010/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: Could not open file for write in copy operation C:/Program Files/Opencv_VS2010/CMakeFiles/CMakeRCCompiler.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineRCCompiler.cmake:65 (CONFIGURE_FILE):
configure_file Problem configuring file
Call Stack (most recent call first):
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:28 (ENABLE_LANGUAGE)
C:/Program Files/CMake
展开
 我来答
DoramiHe
推荐于2017-06-21 · 知道合伙人互联网行家
DoramiHe
知道合伙人互联网行家
采纳数:25332 获赞数:59542
2011年中山职业技术学院毕业,现担任毅衣公司京东小二

向TA提问 私信TA
展开全部
首先,我想说的是CMake的作用,每个编译器在调用头文件的时候都需要编译器配置好读取头文件(*.h)对应的(*.c||*.cpp)的路径,就像调用math.h你得告诉编译器对应的math.c要去什么地方寻找,但是新下载的OpenCV编译器是不知道相应的头文件还有lib文件要去哪里找的,所以程序猿们可以有以下两种方案:
1. 每次创建一个工程,找到调用文件的配置选项,然后手动添加,告诉编译器cv.h在哪,各种库文件(*.lib)文件在哪,当然既然涉及到系统的问题,少不了要去环境变量配置一下系统设置,不过配置环境变量仅仅用一次就可以了。
2. 为了省去每次创建工程都需要手动配置路径的麻烦,用CMake可以将Opencv的相关文件在哪里“永久地”告诉编译器,当然代价就是……失败几率很大(反正我总是配不好,一步出问题就会很蛋疼)
小梧桐木
2013-09-12
知道答主
回答量:35
采纳率:0%
帮助的人:10.5万
展开全部
把openCV放到其他目录下,路径下不能有中文跟空格(Program Files带空格了),试试
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
simon900314
2012-04-27 · 超过30用户采纳过TA的回答
知道答主
回答量:90
采纳率:0%
帮助的人:77.1万
展开全部
现在的OPENCV2.3已经有预编译好的库了(对于VS2010来说),不需要用CMAKE了。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式