编译
apt install openjdk-8-jdk
autoreconf -i
./configure --prefix=/home/zys/work/tool/lcm-1.3.1/lcm-install
make
make install
安装jdk是为了log-player-gui 也可以不编译java 和 py的,可以增加选项./configure –without-lua --without-java
交叉编译
交叉编译不能使用x86的库。但是在做编译链接的时候默认的是使用本地库,即/usr/lib,/lib两个目录。因此,在交叉编译的时候,要采取一些方法使得在编译链接的时候找到需要的库。
./configure --without-lua --without-java --prefix=/home/zys/work/tool/lcm-1.3.1/lcm-arm-install --host=aarch64-linux-gnu LDFLAGS=-L/home/zys/work/tool/lcm_arm_LDFLAGS
问题
libpcre.so.3 not found
/usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld: warning: libpcre.so.3, needed by /usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_dfa_exec'
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_compile2'
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_exec'
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_fullinfo'
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_get_stringtable_entries'
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_config'
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_get_stringnumber'
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_study'
/usr/lib/gcc-cross/aarch64-linux-gnu/7/libglib-2.0.so: undefined reference to `pcre_free'
collect2: error: ld returned 1 exit status
Makefile:453: recipe for target 'lcm-sink' failed
make[1]: *** [lcm-sink] Error 1
make[1]: 离开目录“/home/zys/work/tool/lcm-1.3.1/liblcm-test”
Makefile:428: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
glib>2.0
sudo apt-get install libglib2.0-dev
-lgthread-2.0 -lglib-2.0
交叉编译器库路径在 /usr/lib/gcc-cross/aarch64-linux-gnu/9/
所以需要交叉编译这两个库-lgthread-2.0 -lglib-2.0,放在这个目录
|