tslib1.4編譯過程‘__open_missing_mode’ 錯誤

來源:互聯網
上載者:User

標籤:

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

 

儲存後重新編譯即可

tslib1.4編譯過程‘__open_missing_mode’ 錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.