tiago@tiago-laptop:~/bioloid/build$ cmake ..
-- Checking GNUCXX version 3/4 to determine OpenCV /opt/net/ path
CMake Error at CMakeModules/FindOpenCV.cmake:348 (MESSAGE):
OpenCV required but some headers or libs not found. Please specify it's
location with OpenCV_ROOT_DIR env. variable.
Call Stack (most recent call first):
CMakeLists.txt:45 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
如果我尝试导出这样的变量:
export OpenCV_ROOT_DIR=/usr/local/lib
它一直给出同样的错误,这是pkg-config的输出--cflags --libs opencv:
-I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
团队中没有人知道该怎么做,我已经删除并重新安装了opencv,这是否有可能是因为我的计算机中还有opencv 2.2?
答案 0 :(得分:0)
当您使用自定义Find宏来查找opencv(CMakeModules / FindOpenCV.cmake)时,您应该实际检查此宏需要查找的库。由于看起来这个宏实际上在你的控制之下,我只是将调试消息添加到它的处理中以找出它失败的那一点。如果宏使用对MARK_AS_ADVANCED的调用,那么一个好的策略可以打印出传递给该宏的所有变量。所有变量都需要具有非空的值,false或XXX-NOTFOUND。
除此之外,让我们可以使用这个查找宏的代码有助于调试。