一、问题描述
1. 在获取到tslib-1.21源码后,先通过autogen.sh脚本文件生成Makefile,用于编译源码。在运行autogen.sh时出现了如下错误提示:
configure:13646:error:possibly undefined macro:AC_MSG_ERROR
2. 在make交叉编译完成之后,在输入指令sudo make install编译安装的时候出现了如下问题:
libtool: install: (cd /home/mrluo/tslib/plugins; /bin/bash "/home/mrluo/tslib/libtool" --silent --tag CC --mode=relink arm-none-linux-gnueabihf-gcc -DTS_POINTERCAL=\"home/mrluo/tslib-mp157/etc/pointrcal\" -DTSLIB_INTERNAL -fvisibility=hidden -DGCC_HASCLASSVISIBILITY -O2 -wall -W -fpIC -module -avoid-version -o linear.la -rpath /home/mrluo/tslib/arm-tslib-ma157/lib/ts linear.lo ../src/libts.la -ldl)
libtool: error :error relink 'linear.la' with the above command before installing it
Makefile:813:recipe for target 'install-pluginexecLTLIBRARIES' failed
error:relink 'linear.la' with the above command before installing it
二、问题分析
1.缺少宏相关的文件。
2.问题为libtool找不到linux交叉编译器。(有知道问题原因的可以在评论区回复一下,谢谢)
三、解决办法
1.第一个问题通过安装pkg-config包,即可解决。
sudo apt install pkg-config -y
2.第二个问题是通过修改libtool文件,将提示错误的交叉编译器工具加上绝对路径:
将:
# A language specific compiler.
CC="arm-linux-gnueabihf-gcc"
如:修改为(这是我存放linux交叉编译器的绝对路径)
CC=“/usr/local/arm/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-gcc”