CMake still not working with OpenCV [duplicate]

2020-01-20 11:51发布

Possible Duplicate:
cmake is not working in opencv c++ project

I have a huge problem in CMake and I posted a question but it didn't help.

I keep getting unreasonable errors and me and my partners just can't solve it. Here are the files:

http://dl.dropbox.com/u/62218293/royshil-FoodcamClassifier-4ba20bb.zip

I'm using Visual Studio 2010 on Windows 7. I'm getting the following errors: does anyone have any idea how can I fix this problem ?

'CMake Error: Unable to open cache file for save. C:/Program Files/CMake 2.8/bin/CMakeCache.txt
CMake Error at CMakeLists.txt:4 (FIND_PACKAGE):
  Could not find module FindOpenCV.cmake or a configuration file for package
  OpenCV.

  Adjust CMAKE_MODULE_PATH to find FindOpenCV.cmake or set OpenCV_DIR to the
  directory containing a CMake configuration file for OpenCV.  The file will
  have one of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake



OpenCV_DIR-NOTFOUND
Configuring incomplete, errors occurred!
CMake Error: Unable to open cache file for save. C:/Program Files/CMake 2.8/bin/CMakeCache.txt
CMake Error: : System Error: Permission denied
CMake Error: : System Error: Permission denied'

标签: c++ opencv cmake
1条回答
我欲成王,谁敢阻挡
2楼-- · 2020-01-20 12:17

Have you tried actually setting the environment variables (CMAKE_MODULE_PATH and/or OpenCV_DIR) the error message tells you to set?

You can do that from Control Panel > System > Advanced System Settings > Environment Variables

See if they exist (and point to the correct path), otherwise just create them...

查看更多
登录 后发表回答