opencv-package 'eigen3' not found

本文介绍了解决Autoware编译过程中遇到的找不到OpenCV等依赖包的问题。通过设置环境变量PKG_CONFIG_PATH,指向正确的库文件路径,成功解决了编译错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译Autoware时,出现

Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found

找不到opencv, eigen3, pcl_io-1.7这些package,

则用命令pkg-config –modversion opencv查看一下,确实找不到。
然后在系统的/usr目录下,

find . -name libopencv*

找到opencv的库文件存放的目录,/usr/lib/x86_64-linux-gnu,在命令行或者~/.bashrc中输入:

export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/lib/pkgconfig/:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig

即可

参考资料

  1. https://prateekvjoshi.com/2013/10/18/package-opencv-not-found-lets-find-it/
lixing@lixing:~/fast_livo2$ catkin_make Base path: /home/lixing/fast_livo2 Source space: /home/lixing/fast_livo2/src Build space: /home/lixing/fast_livo2/build Devel space: /home/lixing/fast_livo2/devel Install space: /home/lixing/fast_livo2/install Creating symlink "/home/lixing/fast_livo2/src/CMakeLists.txt" pointing to "/opt/ros/noetic/share/catkin/cmake/toplevel.cmake" #### #### Running command: "cmake /home/lixing/fast_livo2/src -DCATKIN_DEVEL_PREFIX=/home/lixing/fast_livo2/devel -DCMAKE_INSTALL_PREFIX=/home/lixing/fast_livo2/install -G Unix Makefiles" in "/home/lixing/fast_livo2/build" #### -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using CATKIN_DEVEL_PREFIX: /home/lixing/fast_livo2/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /opt/ros/noetic -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3") -- Using PYTHON_EXECUTABLE: /usr/bin/python3 -- Using Debian Python package layout -- Found PY_em: /usr/lib/python3/dist-packages/em.py -- Using empy: /usr/lib/python3/dist-packages/em.py -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/lixing/fast_livo2/build/test_results -- Forcing gtest/gmock from source, though one was otherwise available. -- Found gtest sources under '/usr/src/googletest': gtests will be built -- Found gmock sources under '/usr/src/googletest': gmock will be built -- Found PythonInterp: /usr/bin/python3 (found version "3.8.10") -- Found Threads: TRUE -- Using Python nosetests: /usr/bin/nosetests3 -- catkin 0.8.12 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 4 packages in topological order: -- ~~ - vikit_common -- ~~ - vikit_py -- ~~ - vikit_ros -- ~~ - fast_livo -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin package: 'vikit_common' -- ==> add_subdirectory(rpg_vikit/vikit_common) Current CPU archtecture: x86_64 -- Found OpenCV: /usr/local/opencv3.4 (found version "4.8.0") -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'eigen3' -- Found eigen3, version 3.4.0 -- Found Eigen: /usr/local/include/eigen3 -- Eigen found (include: /usr/local/include/eigen3) -- +++ processing catkin package: 'vikit_py' -- ==> add_subdirectory(rpg_vikit/vikit_py) -- +++ processing catkin package: 'vikit_ros' -- ==> add_subdirectory(rpg_vikit/vikit_ros) -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy -- +++ processing catkin package: 'fast_livo' -- ==> add_subdirectory(fast-livo2-native) -- Build Type: Release -- Current CPU architecture: x86_64 -- Using general x86 optimizations: -O3 -march=native -mtune=native -funroll-loops -- Processor count: 8 -- Multithreading enabled. Cores: 4 -- OpenMP found -- mimalloc not found, proceeding without it -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy -- Could NOT find livox_ros_driver2 (missing: livox_ros_driver2_DIR) -- Could not find the required component 'livox_ros_driver2'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found. CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "livox_ros_driver2" with any of the following names: livox_ros_driver2Config.cmake livox_ros_driver2-config.cmake Add the installation prefix of "livox_ros_driver2" to CMAKE_PREFIX_PATH or set "livox_ros_driver2_DIR" to a directory containing one of the above files. If "livox_ros_driver2" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): fast-livo2-native/CMakeLists.txt:83 (find_package) -- Configuring incomplete, errors occurred! See also "/home/lixing/fast_livo2/build/CMakeFiles/CMakeOutput.log". See also "/home/lixing/fast_livo2/build/CMakeFiles/CMakeError.log". Invoking "cmake" failed
最新发布
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值