melodic版本-moveit源码安装遇到问题及解决

前言

最近在研究ROS moveit的源码,于是使用源码安装,方便调试,于是按照官网进行编译安装,不过编译安装遇到一个奇葩的问题,现把解决方法和问题罗列出来,这里严格来说不是moveit的问题,是我关于Qt5编译环境的问题。

编译报错如下:

Errors     << moveit_visual_tools:make /data/ros/code/ws_moveit/logs/moveit_visual_tools/build.make.001.log                                       
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QBitmap::fromImage(QImage&&, QFlags<Qt::ImageConversionFlag>)@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QWindowPrivate::setVisible(bool)@Qt_5_PRIVATE_API'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QColor::lighter(int) const@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QMessageDialogOptions::customButton(int)@Qt_5_PRIVATE_API'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QGuiApplication::screenAt(QPoint const&)@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QMessageDialogOptions::addButton(QString const&, QPlatformDialogHelper::ButtonRole, void*)@Qt_5_PRIVATE_API'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QStyleHints::showShortcutsInContextMenus() const@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QTest::qWaitForWindowExposed(QWindow*, int)@Qt_5'
//usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: undefined reference to `QLocaleData::validateChars(QString const&, QLocaleData::NumberMode, QByteArray*, int, QFlags<QLocale::NumberOption>) const@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QWindow::setWindowStates(QFlags<Qt::WindowState>)@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QPlatformSystemTrayIcon::contextMenuRequested(QPoint, QPlatformScreen const*)@Qt_5_PRIVATE_API'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QFontMetrics::horizontalAdvance(QString const&, int) const@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QColor::darker(int) const@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QWindow::windowStates() const@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QImage::sizeInBytes() const@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QFontMetrics::horizontalAdvance(QChar) const@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QTest::qWaitForWindowActive(QWindow*, int)@Qt_5'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QGuiApplicationPrivate::sendApplicationPaletteChange(bool, char const*)@Qt_5_PRIVATE_API'
//opt/Qt5.13.0/5.13.0/gcc_64/lib/libQt5Widgets.so.5: undefined reference to `QStyleHints::mouseQuickSelectionThreshold() const@Qt_5'
//usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: undefined reference to `QLocaleData::bytearrayToLongLong(char const*, int, bool*, bool*)@Qt_5'
collect2: error: ld returned 1 exit status
make[2]: *** [/data/ros/code/ws_moveit/devel/.private/moveit_visual_tools/lib/moveit_visual_tools/moveit_visual_tools_demo] Error 1
make[1]: *** [CMakeFiles/moveit_visual_tools_demo.dir/all] Error 2
make: *** [all] Error 2
cd /data/ros/code/ws_moveit/build/moveit_visual_tools; catkin build --get-env moveit_visual_tools | catkin env -si  /usr/bin/make --jobserver-fds=8,9 -j; cd -

解决方案:

观察报错,一般这种报错,要不是没安装QT要不就是环境变量不对,它自己没找到造成报错。
于是我直接在我环境变量里加入如下:
看自己的QT环境所在。

vim ~/.bashrc
export PATH=/opt/Qt5.13.0/5.13.0/gcc_64/bin:$PATH
export LD_LIBRARY_PATH=/opt/Qt5.13.0/5.13.0/gcc_64/lib:$LD_LIBRARY_PATH

编译解决

catkin build
[build] Summary: All 27 packages succeeded!                                                                                                       
[build]   Ignored:   5 packages were skipped or are blacklisted.                                                                                  
[build]   Warnings:  1 packages succeeded with warnings. 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值