tslib库安装

这些天在交叉编译Qt源码。了解到编译之前须编译tslib库 在编译tslib库时遇到过很多问题。这里说出我出过的问题及解决方案。


参考 http://blog.csdn.net/zijie_xiao/article/details/50740950

blog.csdn.net/a1299600490/article/details/51346256

编译源码:

1.下载依赖库及工具

sudo apt-get install autoconf

sudo apt-get install automake

sudo apt-get install libtool


2.生成configure

执行 ./autogen.sh

遇到错误1:

➜  ~/test/tslib-master: ./autogen.sh
configure.ac:24: error: possibly undefined macro: AC_DISABLE_STATIC
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:25: error: possibly undefined macro: AC_ENABLE_SHARED
configure.ac:26: error: possibly undefined macro: AC_LIBTOOL_DLOPEN
configure.ac:27: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1

原因:是因为没有安装上面的libtool

执行 sudo apt-get install libtool 即可。


生成Makefile

预先配置好环境变量,交叉工具链arm-linux-gcc路径

./configure --host=arm-hisiv400-linux --prefix=安装路径

4.编译源码

make && make install

最后在输出目录下生成 bin  etc  include  lib 四个子目录。

bin目录下面为可执行程序 ts_calibrate  ts_harvest  ts_print  ts_print_raw  ts_test
etc目录下面只有一个文件 ts.conf

include目录下面有头文件 tslib.h

lib目录下有 libts-1.0.so.0  libts-1.0.so.0.0.0  libts.la  libts.so  pkgconfig  ts

Linux下编译tslibconfigure之前都正常,但make后就出现错误啦,求解。。

 分享| 2012-03-18 23:14 hc07124988 | 浏览1218次  悬赏:5

 编程语言

终端里最后的内容如下:

In function open,

    inlined from mainat ts_calibrate.c:227:

/usr/include/bits/fcntl2.h:51: error: call to __open_missing_modedeclared with attribute error: open with O_CREAT in second argument needs 3 arguments

In function open,

    inlined from mainat ts_calibrate.c:229:

/usr/include/bits/fcntl2.h:51: error: call to __open_missing_modedeclared with attribute error: open with O_CREAT in second argument needs 3 arguments

make[2]: *** [ts_calibrate.o] 错误 1

make[2]:正在离开目录 `/opt/qt/tslib/tests'

make[1]: *** [all-recursive] 错误 1

make[1]:正在离开目录 `/opt/qt/tslib'

make: *** [all] 错误 2

2013-12-14 10:07 网友采纳

gcc 新版本编译器对语法检查严格,在源文件 ./tests/ts_calibrate.c

 

// 源文件

// if ((calfile = getenv("TSLIB_CALIBFILE")) != NULL) {

//     cal_fd = open (calfile, O_CREAT | O_RDWR);

// } else {

//   cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR);

// }

// 需要更改成如下形式

if ((calfile = getenv("TSLIB_CALIBFILE")) != NULL) {

    cal_fd = open (calfile, O_CREAT | O_RDWR, 0777);

} else {

    cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR, 0777);

}保存后重新编译即可


make 出现错误:undefined reference 'rpl_malloc'
解决:将config.h.in中的
 #undef malloc  行注释掉



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值