rtabmap and rtabmap_ros make error(rtabmap编译错误)

本文详细记录了在编译rtabmap和rtabmap_ros过程中遇到的错误及解决方案,包括rtabmap make错误和catkin_make错误。解决方案涵盖了从替换libpng.so文件、清理缓存、重新安装loam_velodyne到修改源代码中的变量名,以及复制库文件等。

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

Build from source following README.nd in rtabmap_ros

rtabmap make error

Error 1

make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libpng.so', needed by '../bin/rtabmap-extractObject'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libpng.so', needed by '../bin/librtabmap_core.so.0.19.1'.  Stop.
CMakeFiles/Makefile2:1586: recipe for target 'corelib/src/CMakeFiles/rtabmap_core.dir/all' failed
make[1]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
^Ctools/ExtractObject/CMakeFiles/extractObject.dir/build.make:62: recipe for target 'tools/ExtractObject/CMakeFiles/extractObject.dir/main.cpp.o' failed
make[2]: *** [tools/ExtractObject/CMakeFiles/extractObject.dir/main.cpp.o] Interrupt
CMakeFiles/Makefile2:1970: recipe for target 'tools/ExtractObject/CMakeFiles/extractObject.dir/all' failed
make[1]: *** [tools/ExtractObject/CMakeFiles/extractObject.dir/all] Interrupt
Makefile:160: recipe for target 'all' failed
make: *** [all] Interrupt

Solution 1

locate libpng.so

stat /usr/lib/x86_64-linux-gnu/libpng.so

Of course the file exist.

Output:

File: 'libpng.so' -> 'libpng12.so'
Size: 11            Blocks: 0          IO Block: 4096   symbolic link
Device: 816h/2070d  Inode: 6296757     Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-04-04 10:09:50.543715873 +0800
Modify: 2019-04-04 10:09:50.539715795 +0800
Change: 2019-04-04 10:09:50.539715795 +0800
 Birth: -

Copy another libpng.so file from my laptop. Problem fixed.


Error 2

make -j4
[  4%] Built target rtabmap_utilite
[  5%] Built target res_tool
[  5%] Built target imagesJoiner
[  6%] Built target extractObject
[ 42%] Built target rtabmap_core
[ 42%] Linking CXX executable ../../../bin/rtabmap-stereoEval
[ 42%] Linking CXX executable ../../../bin/rtabmap-console
[ 43%] Linking CXX executable ../../../bin/rtabmap-camera
[ 82%] Built target rtabmap_gui
[ 82%] Linking CXX executable ../../../bin/rtabmap-kitti_dataset
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_pinv'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `loam::MultiScanMapper::getRingForAngle(float const&)'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_post'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_calloc'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_malloc'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_nfree'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_spfree'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_etree'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `g2o::csparse_extension::cs_cholsolsymb(cs_sparse const*, double*, cs_symbolic const*, double*, int*)'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_symperm'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_schol'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `g2o::csparse_extension::writeCs2Octave(char const*, cs_sparse const*, bool)'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_cumsum'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_sfree'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_amd'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `g2o::csparse_extension::cs_chol_workspace(cs_sparse const*, cs_symbolic const*, int*, double*)'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_free'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_counts'
collect2: error: ld returned 1 exit status
tools/ConsoleApp/CMakeFiles/consoleApp.dir/build.make:741: recipe for target '../bin/rtabmap-console' failed
make[2]: *** [../bin/rtabmap-console] Error 1
CMakeFiles/Makefile2:1860: recipe for target 'tools/ConsoleApp/CMakeFiles/consoleApp.dir/all' failed
make[1]: *** [tools/ConsoleApp/CMakeFiles/consoleApp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_pinv'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_calloc'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_etree'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_symperm'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_schol'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `g2o::csparse_extension::writeCs2Octave(char const*, cs_sparse const*, bool)'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_cumsum'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_amd'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `g2o::csparse_extension::cs_chol_workspace(cs_sparse const*, cs_symbolic const*, int*, double*)'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_free'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `loam::MultiScanMapper::getRingForAngle(float const&)'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_post'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `cs_malloc'
../../../bin/librtabmap_core.so.0.19.1: undefined reference to `c
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值