问题
编译一个开源项目,该项目的Cmakelist:
find_package(OpenCV QUIET COMPONENTS core highgui imgproc imgcodecs)
if(NOT OpenCV_FOUND)
find_package(OpenCV REQUIRED COMPONENTS core highgui imgproc)
endif()
cmake后出错:
CMake Error at examples/CMakeLists.txt:5 (find_package):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK,

在编译一个使用OpenCV的开源项目时,CMakeLists配置出错。错误源于未正确设置OpenCV的路径。通过修改CMakeLists,尝试使用find_package()并设置OpenCV_DIR,但仍然遇到找不到库和头文件的问题。最终,通过添加头文件路径和库路径解决了部分问题,但仍有找不到opencv.lib的错误。问题在于未指定正确的库文件名。寻求进一步的解决方案。
最低0.47元/天 解锁文章
3238

被折叠的 条评论
为什么被折叠?



