gtsam:undefined symbol: _ZTVN5gtsam19GaussianFactorGraphE

文章讲述了在使用GTSAM时遇到的nodelet加载失败问题,原因可能是缺少链接库和符号定义。解决方案是在CMakeLists.txt中正确添加GTSAM库到target_link_libraries。
摘要由CSDN通过智能技术生成

在使用gtsam的时候出现问题:

[ERROR] [1712107483.937877766]: Failed to load nodelet [/globalmap_server_nodelet] of type [hdl_localization/GlobalmapServerNodelet] even after refreshing the cache: Failed to load library /home/robot/catkin_ws/devel/lib//libglobalmap_server_nodelet.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /home/robot/catkin_ws/devel/lib//libglobalmap_server_nodelet.so: undefined symbol: _ZTVN5gtsam19GaussianFactorGraphE)

[ERROR] [1712107483.937907728]: The error before refreshing the cache was: Failed to load library /home/robot/catkin_ws/devel/lib//libglobalmap_server_nodelet.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /home/robot/catkin_ws/devel/lib//libglobalmap_server_nodelet.so: undefined symbol: _ZTVN5gtsam19GaussianFactorGraphE)

[FATAL] [1712107483.938048249]: Failed to load nodelet '/globalmap_server_nodelet` of type `hdl_localization/GlobalmapServerNodelet` to manager `hdl_nodelet_manager'

解决方法

cmakelisttarget_link_libraries里面添加gtsam

貌似前面的那个GTSAM_LIBRARY_DIRS 没卵用,有可能是写错了

add_library(globalmap_server_nodelet apps/globalmap_server_nodelet.cpp)

target_link_libraries(globalmap_server_nodelet

${catkin_LIBRARIES}

${PCL_LIBRARIES}

${OpenCV_LIBRARY_DIRS}

${GTSAM_LIBRARY_DIRS}

gtsam

${glog_LIBRARY_DIRS}

)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值