tslib1.4 compilation process ' __open_missing_mode ' ERROR

Source: Internet
Author: User

tslib1.4 compilation process

./autogen.sh
echo "Ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
# set Target model, buffer, installation path
./configure--host=arm-linux--cache-file=arm-linux.cache--prefix=/opt/tslib
Make
# If the target path does not have permissions, add sudo
Make install


Errors that may be encountered

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

New version of GCC compiler is strict with syntax checking in source files./tests/ts_calibrate.c

source file
if ((Calfile = getenv ("Tslib_calibfile")) = = NULL) {
cal_fd = open (Calfile, O_creat | O_RDWR);
} else {
cal_fd = open ("/etc/pointercal", O_creat | O_RDWR);
// }
Needs to be changed into the following form
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);
}

Save and recompile

tslib1.4 compilation process ' __open_missing_mode ' ERROR

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.