cmake在opencv c ++项目中不工作 [英] cmake is not working in opencv c++ project
问题描述
我需要你的帮助!
此链接中有此C ++代码
I need your help ! I have this C++ code in this link
[link] https://github.com/royshil/FoodcamClassifier
我一直在尝试从两天来compaile它,我失败的
他们说我必须使用cmake,我试过GUI版本,它给我的错误realted到cmake本身
所以我拿了cpp和头文件,并做了一个新的项目但我现在有100个错误与opencv库相关,我发誓上帝我确定包含文件夹和它的libs在我的项目!不知道是什么问题!
and I've been trying since two days to compaile it , and I've failed they say that I have to use cmake , I've tried the "GUI version and it gave me errors realted to the cmake itself . so I took the cpp and header files and made a new project but I have now 100 errors related to the opencv library and I swear to god I'm sure of the include folders and the libs of it in my project ! don't know what's the matter with it !
以下是错误:
'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 '
推荐答案
您可能需要在 CMakeLists.txt $中添加以下代码c $ c> 之前
FIND_PACKAGE(OpenCV必填)
(在我的情况下):
SET("OpenCV_DIR" "PATH/TO/CMake/build")
在我的安装中,它解决了这个问题,因为上述文件位于build文件夹中。
In my installation it solved the problem since the mentioned files are located in the build folder.
这篇关于cmake在opencv c ++项目中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!