错误描述
CMake Warning at CMakeLists.txt:123 (add_executable):
Cannot generate a safe runtime search path for target mono_euroc because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libopencv_stitching.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_aruco.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_bgsegm.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_bioinspired.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_ccalib.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_dnn_objdetect.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_dnn_superres.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_dpm.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_highgui.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_face.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_freetype.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_fuzzy.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_hdf.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_hfs.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_img_hash.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_line_descriptor.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_quality.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_reg.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_rgbd.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_saliency.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_shape.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_stereo.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_structured_light.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_phase_unwrapping.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_superres.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_optflow.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_surface_matching.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_tracking.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_datasets.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_plot.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_text.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_dnn.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_ml.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_videostab.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_videoio.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_viz.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_ximgproc.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_video.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_xobjdetect.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_imgcodecs.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_objdetect.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_calib3d.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_features2d.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_flann.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_xphoto.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_photo.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_imgproc.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
runtime library [libopencv_core.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
Some of these libraries may not be found correctly.
解决方法
SET(OpenCV_DIR /usr/local/lib/cmake/opencv4/) # 设置OpenCV_DIR
SET(OpenCV_DIR /usr/local/lib/cmake/opencv4/) # 设置OpenCV_DIR
find_package(OpenCV QUIET)
if(NOT OpenCV_FOUND)
find_package(OpenCV 2.4.3 QUIET)
if(NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
endif()
endif()
# If the package has been found, several variables will
# be set, you can find the full list with descriptions
# in the OpenCVConfig.cmake file.
# Print some message showing some of them
message(STATUS "OpenCV library status:")
message(STATUS " config: ${OpenCV_DIR}")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
文章来源地址https://www.toymoban.com/news/detail-800671.html
文章来源:https://www.toymoban.com/news/detail-800671.html
到了这里,关于在用cmake编译时,遇到opencv报错runtime library的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!