tslib1.4编译过程‘__open_missing_mode’ 错误

tslib1.4编译过程

 

./autogen.sh
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
# 设置目标机型,缓冲,安装路径
./configure --host=arm-linux --cache-file=arm-linux.cache --prefix=/opt/tslib
make
# 如果目标路径没有权限,需要加 sudo
make install

 


可能遇到的错误

 

In file included from /usr/include/fcntl.h:252:0,
from /usr/include/sys/fcntl.h:1,
from ts_calibrate.c:20:
In function ‘open’,
inlined from ‘main’ at ts_calibrate.c:227:11:
/usr/include/bits/fcntl2.h:51:24: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
In function ‘open’,
inlined from ‘main’ at ts_calibrate.c:229:11:
/usr/include/bits/fcntl2.h:51:24: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[2]: *** [ts_calibrate.o] Error 1
make[2]: Leaving directory `/home/ouyang/Downloads/tslib/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ouyang/Downloads/tslib'
make: *** [all] Error 2

 

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);
}

 

保存后重新编译即可

转载于:https://www.cnblogs.com/jianglg3/p/5102976.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值