ubuntu(15):对‘casadi::MX::MX(casadi::MX const&)’未定义的引用

        (catkin build)编译报错,找不到CASADI的头文件目录CASADI_INCLUDE_DIRS或者库文件也达不到CASADI_LIBRARIES;

        对‘casadi::MX::horzsplit(casadi::MX const&, std::vector<long long, std::allocator<long long> > const&)’未定义的引用
        对‘casadi::Sparsity::size2() const’未定义的引用
        对‘casadi::MX::MX(casadi::MX const&)’未定义的引用

CMake Warning at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:166 (message):
  catkin_package() DEPENDS on 'CASADI' but neither 'CASADI_INCLUDE_DIRS' nor
  'CASADI_LIBRARIES' is defined.
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
  CMakeLists.txt:38 (catkin_package)bit

/usr/bin/ld: warning: libopencv_core.so.2.4, needed by /usr/local/lib/libopencv_imgproc.so.2.4.13, may conflict with libopencv_core.so.3.2
/home/bit/planing_and_control_ws/devel/.private/path_smoothing/lib/libpath_smoothing.so:对‘casadi::MX::horzsplit(casadi::MX const&, std::vector<long long, std::allocator<long long> > const&)’未定义的引用
/home/bit/planing_and_control_ws/devel/.private/path_smoothing/lib/libpath_smoothing.so:对‘casadi::Sparsity::size2() const’未定义的引用
/home/bit/planing_and_control_ws/devel/.private/path_smoothing/lib/libpath_smoothing.so:对‘casadi::MX::MX(casadi::MX const&)’未定义的引用

解决方案:

        先查找库文件的绝对路径

sudo find | grep "libcasadi"

        得到结果如下:

/usr/local/lib/libcasadi_integrator_rk.so.3.6
/usr/local/lib/libcasadi_linsol_symbolicqr.so.3.6
/usr/local/lib/libcasadi_rootfinder_nlpsol.so.3.6
。。。
。。。
/usr/local/lib/libcasadi_linsol_lsqr.so
/usr/local/lib/libcasadi_integrator_collocation.so.3.6
/usr/local/lib/libcasadi_integrator_rk.so

        添加绝对路径到add_library()

add_library(xxx_node
#其他库
/usr/local/lib/libcasadi_integrator_rk.so.3.6
/usr/local/lib/libcasadi_linsol_symbolicqr.so.3.6
。。。
。。。
/usr/local/lib/libcasadi_linsol_lsqr.so
/usr/local/lib/libcasadi_integrator_collocation.so.3.6
/usr/local/lib/libcasadi_integrator_rk.so
)

参考:

安装casadi_大宝啊啊啊啊的博客-CSDN博客_matlab安装casadi

@meng

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值