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

今天安装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正常。。。。

阅读更多
版权声明:本文为博主原创文章,若转载请注明出处;若有错误,欢迎指出;若有问题,欢迎留言。 https://blog.csdn.net/lzhui1987/article/details/51987409
个人分类: Linux运维
上一篇【Python语法】python中__name__
下一篇linux中设置环境变量和gcc/g++的include路径
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭