warning: libopencv_core.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so, may conflict with lib

这篇具有很好参考价值的文章主要介绍了warning: libopencv_core.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so, may conflict with lib。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

最近想在树莓派4b上的ROS系统运行ORB-SLAM2,过程中遇到了一个比较棘手的问题。虽然最后看似瞎猫碰死耗子解决了,但是不知道有没有遗留一些奇怪问题。这里做一个简单记录。

树莓派4b:安装了官方Ubuntu20 Server,随后再安装了ubuntu-desktop桌面。
安装了opencv3

ORB-SLAM2:官方版本。

最终遇到了ROS Noetic和ubuntu的opencv版本冲突,前者是opencv4,后者opencv3。问题如下:

/usr/bin/ld: warning: libopencv_imgproc.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so, may conflict with libopencv_imgproc.so.3.4
/usr/bin/ld: warning: libopencv_core.so.4.2, needed/usr/bin/ld: warning: libopencv_imgproc.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so,  by /mayopt/ros/noetic/lib/libcv_bridge.so, may conflict with  conflictlibopencv_core.so.3.4
/usr/ withbin/ld: CMakeFiles/Stereo.dir/src/ros_stereo.cc.o: undefined reference to symbol '_ZNK2cv8FileNodecviEv'
/usr/bin/ld: /usr/lib/aarch64-linux libopencv_imgproc.so.3.4
/usr/bin/ld: CMakeFiles/MonoAR.dir/src/AR/ViewerAR.cc.o: undefined reference to symbol '_ZN2cv7putTextERKNS_17_InputOutputArrayERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6Point_IiEEidNS_7Scalar_IdEEiib'
/usr/bin/ld: /usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.4.2.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
-gnu/libopencv_core.so.4.2.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/MonoAR.dir/build.make:268: ../MonoAR] Error 1
make[1]: *** [CMakeFiles/Makefile2:541: CMakeFiles/MonoAR.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/Stereo.dir/build.make:198: ../Stereo] Error 1
make[1]: *** [CMakeFiles/Makefile2:568: CMakeFiles/Stereo.dir/all] Error 2
/usr/bin/ld: warning: libopencv_core.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so, may conflict with libopencv_core.so.3.4
/usr/bin/ld: warning: libopencv_core.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so, may conflict with libopencv_core.so.3.4
[ 55%] Built target Mono
[ 66%] Built target RGBD
make: *** [Makefile:130: all] Error 2

ROS系统要libopencv_core.so.4.2,libopencv_imgproc.so.4.2,但是ORB-SLAM2的Cmakelist用的是libopencv_core.so.3.4,libopencv_imgproc.so.3.4。
看了下网上介绍,大致有三种解法:
1 换个用opencv4的ORB-SLAM2, github上有 https://github.com/mateomd-dev/orb-slam2。
2 让ROS cv_bridge采用opencv3,或者重新安装一个cv_bridge。

3 引入libopencv_core.so.4.2,libopencv_imgproc.so.4.2。

本人用的是方法3,坦白说这个是我实验了很多遍才找到的,并非是我有什么理论认识。具体做法是ros的cmakelist.txt中加入以下

/usr/local/lib/libopencv_core.so.3.4
/usr/local/lib/libopencv_imgproc.so.3.4
/usr/lib/aarch64-linux-gnu/libopencv_core.so.4.2
/usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.4.2
-lboost_system

结果如下:

set(LIBS 
${OpenCV_LIBS} 
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
/usr/local/lib/libopencv_core.so.3.4
/usr/local/lib/libopencv_imgproc.so.3.4
/usr/lib/aarch64-linux-gnu/libopencv_core.so.4.2
/usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.4.2
-lboost_system
)

就这样~文章来源地址https://www.toymoban.com/news/detail-485537.html

到了这里,关于warning: libopencv_core.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so, may conflict with lib的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • mysql 安装问题 perl(JSON) is needed by mysql-community-test

    执行命令 :yum install perl-JSON 进行在线安装即可解决

    2024年02月07日
    浏览(36)
  • You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true

    遇到一个问题 关键点: You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 翻译一下: CST 2022 WARN:不建议在没有服务器身份验证的情况下建立SSL连接。 根据MySQL 5.5.45+、5.6.26+和5.7.6+的要求,如果没有设置显式选项,默

    2023年04月08日
    浏览(34)
  • 解决RuntimeError: one of the variables needed for gradient computation has been modified by an inplace

    错误:RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [6,128,60,80]], which is output 0 of SoftmaxBackward , is at version 1; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_de

    2024年02月08日
    浏览(35)
  • 【完美解决】RuntimeError: one of the variables needed for gradient computation has been modified by an inp

    💛Pytorch深度学习·理论篇(2023版) https://blog.csdn.net/qq_39237205/category_12077968.html   💚Pytorch深度学习·动手篇(2023版) https://blog.csdn.net/qq_39237205/category_12077994.html 【就看这一篇就行】RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatT

    2024年01月16日
    浏览(48)
  • Git 提示 “warning: LF will be replaced by CRLF“的思考

      在windows平台进行 git add 时, 控制台有时会打印警告 warning: in the working copy of ‘XXX.sh’, LF will be replaced by CRLF the next time Git touches it.   查看了一些资料, 大概弄清了 core.autocrlf 配置选项的作用: git config --global core.autocrlf true 适用于Windows系统, 且一般为Windows默认设置, 会在提

    2024年01月18日
    浏览(44)
  • rpmlib(PayloadIsZstd) <= 5.4.18-1 is needed by lib64pcre2-8_0-10.37-2.x86_64

    通过 rpm -ivh 安装rpm包,然后出现依赖检查错误: 在此服务器安装其他rpm包没得问题,单独安装这个包有问题,再分析此安装包的版本有很多,可能原因在与安装包的版本太高或太低导致的 在https://pkgs.org/search/?q=libpcreon=name下载低版本依赖 下载 libpcre2-8-0-10.39-150400.2.3.x86_64.r

    2024年02月13日
    浏览(27)
  • 报错解决 one of the variables needed for gradient computation has been modified by an inplace operation

     one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [16, 64, 256, 256]], which is output 0 of LeakyReluBackward1, is at version 1;  最近跑代码遇到了这样的一个问题,在网上找了很多方法都没有很好的解决,今天就在这个博客里面将所有的解决办法整

    2024年02月16日
    浏览(39)
  • cn.hutool.core.exceptions.DependencyException:You need to add dependency of ‘poi-ooxml‘....>=4.12

    再继续往下看报错信息,可看到有 打开hutool 官网,在hutool官网搜索报错信息,如下,即可搜到以下解决方案:点击即可打开 从hutool 官网 可见造成这个问题的3个原因: 部分用户使用POI模块时会提示: 一般以下几个原因: 没有引入POI相关jar或引入版本太低 引入了多个版本的

    2024年02月15日
    浏览(40)
  • Centos /lib64/libc.so.6: version `GLIBC_2.28‘ not found (required by

    本文向大家介绍Centos系统在启动一些服务的时候会碰到的/lib64/libc.so.6: version `GLIBC_2.28’ not found (required by…的问题的解决方法,根据提示可知碰到此问题,是因为没有找到GLIBC_2.28版本,需要添加GLIBC的2.28版本 运行该命令后会报下面两个错误 先执行 之后再执行 会遇到报错2

    2024年02月12日
    浏览(39)
  • 第三方应用调用系统SO 库失败Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library

    在Android 31平台,尝试使用第三方应用调用系统SO 库,会报如下的错误 Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library \\\" /system/lib64/XXX.so \\\" needed or dlopened by \\\"/apex/com.android.art/lib64/libnativeloader.so\\\" is not accessible for the namespace \\\"classloader-namespace\\\" 大体原因是,Android N 开始限制 第三方

    2024年02月12日
    浏览(57)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包