在PC机ubuntu16.04系统下为树莓派4B交叉编译ROS应用程序包整到绝望-菜鸟的几天奋战经历

 2020-05-03 

参考文献:
[1] https://medium.com/@tahsincankose/cross-compiling-ros-project-for-arm-263642b405ac

宿主机平台:虚拟机ubuntu16.04LTS系统
目标运行平台:树莓派4B
目标平台系统:Raspbian Buster with desktop and recommended software
采用的方法:

  1. 在树莓派平台上编译好ROS kinetic,并拷贝到PC ubuntu16下面(/home/liqiang/work/linux/raspberrypi/lib/);
  2. 拷贝树莓派系统下的/usr和/lib两个目录拷贝到PC ubuntu16下面(/home/liqiang/work/linux/raspberrypi/lib/);
  3. 可以查看ROS kinetic的share目录下的cmake的find_package命令所需的配置文件中的内容,比如cv_bridgeConfig.cmake,其中有:
1
`set(libraries "cv_bridge;/usr/local/lib/libopencv_core.so.3.4.3;/usr/local/lib/libopencv_imgproc.so.3.4.3;/usr/local/lib/libopencv_imgcodecs.so.3.4.3")`

可以看到,其连接的共享库都指向本地目录这都是PC环境下运行的共享库,我们需要替换其中的内容;
4. 修改kinect下所有文件中跟PC环境库和头文件相关的位置到从树莓派4b拷贝过来的目录对应位置:其中(以下指令均在kinect目录下执行)

1
2
3
4
5
6
7
8
9
find . -type f  | xargs sed -i 's#/opt/ros/kinetic#${CMAKE_CROSS_COMPILE_PREFIX}#g'

find . -type f  | xargs sed -i 's#/usr/lib#${CMAKE_CROSS_COMPILE_PREFIX}/usr/lib#g'
`
find . -type f  | xargs sed -i 's#/usr/local/lib#${CMAKE_CROSS_COMPILE_PREFIX}/usr/local/lib#g'

find . -type f  | xargs sed -i 's#/usr/local/include#${CMAKE_CROSS_COMPILE_PREFIX}/usr/local/include#g'

find . -type f  | xargs sed -i 's#/usr/include#${CMAKE_CROSS_COMPILE_PREFIX}/usr/include#g'``
  1. 配置好交叉编译环境,这里下载自:https://github.com/raspberrypi/tools,使用的是gcc-linaro-arm-linux-gnueabihf-raspbian-x64 (大坑)
  2. 编写rostoolchain.cmake文件,其内容为,详见参考文献1,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf)

set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)


SET(RASPBERRY_ROOT_PATH /home/liqiang/work/linux/raspberrypi/lib)
SET(RASPBERRY_KINETIC_PATH ${RASPBERRY_ROOT_PATH}/opt/ros/kinetic)

SET(CMAKE_FIND_ROOT_PATH ${RASPBERRY_ROOT_PATH} ${CATKIN_DEVEL_PREFIX})

SET(CMAKE_PREFIX_PATH ${RASPBERRY_KINETIC_PATH} ${RASPBERRY_ROOT_PATH}/usr)

# Have to set this one to BOTH, to allow CMake to find rospack
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)


#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${RASPBERRY_ROOT_PATH}" CACHE INTERNAL "" FORCE)
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${RASPBERRY_ROOT_PATH}" CACHE INTERNAL "" FORCE)
#SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} --sysroot=${RASPBERRY_ROOT_PATH}" CACHE INTERNAL "" FORCE)
#SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} --sysroot=${RASPBERRY_ROOT_PATH}" CACHE INTERNAL "" FORCE)

SET(LD_LIBRARY_PATH ${RASPBERRY_KINETIC_PATH}/lib)

include_directories(/home/liqiang/work/linux/raspberrypi/lib/usr/include/arm-linux-gnueabihf)
set(CMAKE_CROSS_COMPILE_PREFIX /home/liqiang/work/linux/raspberrypi/lib)
LINK_DIRECTORIES(${CMAKE_CROSS_COMPILE_PREFIX}/lib/arm-linux-gnueabihf)
  1. 在catkin工程目录下运行以下指令,进行编译
1
catkin_make -DCMAKE_TOOLCHAIN_FILE=/home/liqiang/work/mobileRobot/rostoolchain.cmake

备注:得到这样的结果已经奋战了好几天了,离成功不远了。

解决试探:
可以看到库有问题,但究竟谁的库有问题了(交叉编译器的自带的库还是从目标机器拷贝的库),标准c:库交叉编译器自带的为libc-2.13.so,而树莓派的库为libc-2.28.so,标准C++库:通过执行以下指令:

1
readelf -a libstdc++.so | grep 3.4

比较得知,交叉编译器的c++库只支持到GLIBCXX_3.4.19,而树莓派系统自带的库支持到GLIBCXX_3.4.25,故编译器的库版本较低。从编译错误看出,需要支持到GLIBCXX_3.4.21。
决定用树莓派的库替换交叉编译器的库,结果是连编译都无法完成了,不是连接错误。
看来需要更高版本的交叉编译器了,查看编译器的版本:

1
arm-linux-gnueabihf-gcc -v

树莓派:gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)
交叉编译器: gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03)

可以看出,交叉编译器的版本很低,进而需要寻找更高版本的交叉编译器,在错误编译结果之后给出寻找正确交叉编译器的过程:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
错误编译结果:
[ 66%] Building CXX object robot_base/bin/CMakeFiles/robot_base.dir/src/Communication.cpp.o
[ 66%] Building CXX object robot_base/bin/CMakeFiles/robot_base.dir/src/main.cpp.o
[100%] Linking CXX executable robot_base
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libcrypt.so.1: undefined reference to `__open_nocancel@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_replace_aux(unsigned int, unsigned int, unsigned int, wchar_t)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libroscpp.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned int, unsigned int, char const*, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libroscpp.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libroscpp.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `bool std::has_facet<std::__cxx11::messages<char> >(std::locale const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `VTT for std::__cxx11::basic_stringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `bool std::has_facet<std::__cxx11::messages<wchar_t> >(std::locale const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_append(wchar_t const*, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libuuid.so.1: undefined reference to `fcntl64@GLIBC_2.28'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_sync(wchar_t*, unsigned int, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libcrypt.so.1: undefined reference to `__read_nocancel@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__close_nocancel@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libapr-1.so.0: undefined reference to `__fdelt_chk@GLIBC_2.15'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_filesystem.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_replace(unsigned int, unsigned int, wchar_t const*, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/librosconsole.so: undefined reference to `std::logic_error::logic_error(char const*)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libroscpp.so: undefined reference to `typeinfo for std::ios_base::failure[abi:cxx11]@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `operator delete(void*, unsigned int)@CXXABI_1.3.9'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_create(unsigned int&, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libroscpp.so: undefined reference to `std::__cxx11::numpunct<char> const& std::use_facet<std::__cxx11::numpunct<char> >(std::locale const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned int, char)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__recv@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_erase(unsigned int, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::invalid_argument::invalid_argument(char const*)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::operator=(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libdl.so.2: undefined reference to `_dl_catch_error@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libroscpp.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__shm_directory@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_filesystem.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_last_of(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__pthread_barrier_wait@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned int, unsigned int, unsigned int, char)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned int, unsigned int, char const*, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned int, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libroscpp.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_of(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct(unsigned int, char)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libroscpp.so: undefined reference to `fcntl@GLIBC_2.28'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `std::logic_error::logic_error(std::logic_error const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_filesystem.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__pthread_get_minstack@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::overflow_error::overflow_error(char const*)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::compare(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libdl.so.2: undefined reference to `_dl_signal_error@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::collate<char> const& std::use_facet<std::__cxx11::collate<char> >(std::locale const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_construct(unsigned int, wchar_t)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::runtime_error::runtime_error(std::runtime_error const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::insert(unsigned int, char const*)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libuuid.so.1: undefined reference to `getrandom@GLIBC_2.25'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_thread.so: undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__clock_gettime@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::compare(wchar_t const*) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_filesystem.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_not_of(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libaprutil-1.so.0: undefined reference to `__explicit_bzero_chk@GLIBC_2.25'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_assign(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned int&, unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned int, unsigned int, char const*) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__libc_pread@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf2_ros.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::swap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_ostringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::~basic_ostringstream()@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `VTT for std::__cxx11::basic_ostringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/libcrypt.so.1: undefined reference to `__snprintf@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__socket@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::collate<wchar_t> const& std::use_facet<std::__cxx11::collate<wchar_t> >(std::locale const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/libtf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::numpunct<wchar_t> const& std::use_facet<std::__cxx11::numpunct<wchar_t> >(std::locale const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::~basic_string()@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `vtable for std::__cxx11::basic_ostringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::messages<wchar_t> const& std::use_facet<std::__cxx11::messages<wchar_t> >(std::locale const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_last_not_of(char, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/librt.so.1: undefined reference to `__pthread_barrier_init@GLIBC_PRIVATE'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `vtable for std::__cxx11::basic_stringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned int)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_not_of(char, unsigned int) const@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/opt/ros/kinetic/lib/librosconsole.so: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/lib/arm-linux-gnueabihf/liblog4cxx.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >@GLIBCXX_3.4.21'
/home/liqiang/work/linux/raspberrypi/lib/usr/local/lib/libboost_regex.so: undefined reference to `std::__cxx11::messages<char> const& std::use_facet<std::__cxx11::messages<char> >(std::locale const&)@GLIBCXX_3.4.21'
collect2: error: ld returned 1 exit status
robot_base/bin/CMakeFiles/robot_base.dir/build.make:143: recipe for target 'robot_base/bin/robot_base' failed
make[2]: *** [robot_base/bin/robot_base] Error 1
CMakeFiles/Makefile2:2080: recipe for target 'robot_base/bin/CMakeFiles/robot_base.dir/all' failed
make[1]: *** [robot_base/bin/CMakeFiles/robot_base.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed

待续。。。