侧边栏壁纸
  • 累计撰写 185 篇文章
  • 累计创建 77 个标签
  • 累计收到 18 条评论

目 录CONTENT

文章目录

Linux下编译libxml源码时,报错:/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to '__open...

码峰
2022-09-14 / 0 评论 / 0 点赞 / 1,060 阅读 / 130 字 / 正在检测是否收录...
广告 广告

问题描述

在Linux中编译libxml的源码时,报错如下:

In function 'open',
    inlined from 'xmlNanoHTTPSave' at nanohttp.c:1185:12:
/usr/include/x86_64-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 ();

解决方法

解决方法是,修该nanohttp.c文件1185行,如下:

-        fd = open(stat_path, O_CREAT | O_WRONLY | O_TRUNC);
+        fd = open(stat_path, O_CREAT | O_WRONLY | O_TRUNC, 0600);

修改之后,再次make就正常了。

0
广告 广告

评论区