您的位置:首页 > 运维架构

error: call to '__open_missing_mode' declared with attribute error:

2016-07-21 22:24 591 查看
今天安装gettext-0.17时,make命令出现了下面的错误,后面找了半天的资料才解决,记录一下:

In file included from /usr/include/fcntl.h:289:0,

from ../gnulib-lib/fcntl.h:27,

from write-catalog.c:25:

In function ‘open’,

inlined from ‘msgdomain_list_print’ at write-catalog.c:223:7:

/usr/include/i386-linux-gnu/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments

__open_missing_mode ();

从报错的字面意思应该可以看出来open with O_CREAT or O_TMPFILE in second argument needs 3 arguments这句话的意思是使用open函数时,当第二个参数用O_CREAT时,表示创建文件,需要使用第三个参数将文件赋予权限。定位到write-catalog.c的223行,果然只使用了两个参数,在后面添加0777:

fd = open (filename, O_WRONLY | O_CREAT,0777);

make正常。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: