用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 展开
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 展开
3个回答
推荐于2017-06-21 · 知道合伙人互联网行家
关注
展开全部
首先,我想说的是CMake的作用,每个编译器在调用头文件的时候都需要编译器配置好读取头文件(*.h)对应的(*.c||*.cpp)的路径,就像调用math.h你得告诉编译器对应的math.c要去什么地方寻找,但是新下载的OpenCV编译器是不知道相应的头文件还有lib文件要去哪里找的,所以程序猿们可以有以下两种方案:
1. 每次创建一个工程,找到调用文件的配置选项,然后手动添加,告诉编译器cv.h在哪,各种库文件(*.lib)文件在哪,当然既然涉及到系统的问题,少不了要去环境变量配置一下系统设置,不过配置环境变量仅仅用一次就可以了。
2. 为了省去每次创建工程都需要手动配置路径的麻烦,用CMake可以将Opencv的相关文件在哪里“永久地”告诉编译器,当然代价就是……失败几率很大(反正我总是配不好,一步出问题就会很蛋疼)
1. 每次创建一个工程,找到调用文件的配置选项,然后手动添加,告诉编译器cv.h在哪,各种库文件(*.lib)文件在哪,当然既然涉及到系统的问题,少不了要去环境变量配置一下系统设置,不过配置环境变量仅仅用一次就可以了。
2. 为了省去每次创建工程都需要手动配置路径的麻烦,用CMake可以将Opencv的相关文件在哪里“永久地”告诉编译器,当然代价就是……失败几率很大(反正我总是配不好,一步出问题就会很蛋疼)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |