Could not find a package configuration file provided by “OpenCV“ with any of the following names: Op
Opencv The not of with File by Find
2023-09-11 14:19:19 时间
使用Cmake报错
CMake Error at CMakeLists.txt:12 (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, be sure it has been
installed.
方法已经给出
1.Add the installation prefix of “OpenCV” to CMAKE_PREFIX_PATH
or
2.set “OpenCV_DIR” to a directory containing one of the above files
翻译:
1.将opencv安装目录添加到CMAKE_PREFIX_PATH
例如,按照错误信息指示,在CMakeLists.txt中加入一行list,路径要改成自己的opencv安装路径。
list(APPEND CMAKE_PREFIX_PATH "/home/xiaoming/opencv4.5.5/")
find_package(OpenCV REQUIRED)
或者
2.设置OpenCV_DIR为一个包含OpenCVConfig.cmake或者opencv-config.cmake的目录
按照错误信息指示,在CMakeLists.txt中加入一行set OpenCV_DIR,以opencv4为例,后面的路径要改成你的路径,注意不是安装根目录,是安装目录中包含OpenCVConfig.cmake的文件夹路径
set(OpenCV_DIR /opt/opencv4.5.5/lib/cmake/opencv4)
find_package(OpenCV REQUIRED)
相关文章
- The superclass"javax.servlet.http.HttpServlet" was not found on the Java Build Path
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
- Cannot import the keyfile 'blah.pfx' - error 'The keyfile may be password protected'
- The DELETE statement conflicted with the REFERENCE constraint
- The revocation function was unable to check revocation for the certificate
- The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 2.0 or lower, or use a version of the .NET SDK that supports .NET Core 2.1.
- 解决问题“The App ID ‘XXXXX‘ appears to be in use by the App Store, so it can not be removed at this ti”
- python如何获取一个视频的帧率_python-使用OpenCV计算视频文件中的帧数?
- 报错:The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH. Please check your CLASSPATH specification, and the name of the driver.
- 基于OpenCV实现的图像油画效果代码(高效率、低耗时的C++代码-带详细注释)
- 一个简单的方法查看自己手上的OpenCV的build库的版本号
- OpenCV函数inRange()的作用及使用时的注意事项
- OpenCV中Mat总结
- Package opencv was not found in the pkg-config search path. Perhaps you should add the directory con
- The attribute required is undefined for the annotation type XmlElementRef
- The library 'xxx.jar' contains native libraries that will not run on the device. 解决方法(Eclipse)
- Installing Windows Identity Foundation on Windows 8 - The Certificate for the signer of the message is invalid or not found.
- Solve Warning: The elevation provided <Paper elevation={24}> is not available in the theme.
- [CareerCup] 7.6 The Line Passes the Most Number of Points 经过最多点的直线
- OpenCV show two cameras 同时显示两个摄像头
- mysql重连,连接丢失:The last packet successfully received from the server--转载
- Eclipse Maven项目出现“The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path”
- The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'
- 圣诞特辑-解决idea新建报错The required Java version 11 is not supported by the project SDK 1.8.
- The CompilerVersion constant identifies the internal version number of the Delphi compiler.