qemu编译报错util/memfd.c:44:12: error: static declaration of ‘memfd_create’ follows non-static declara

报错详情

make[1]: flex: Command not found
         BISON dtc-parser.tab.c
make[1]: bison: Command not found
         LEX dtc-lexer.lex.c
make[1]: flex: Command not found
make[1]: '/soft/qemu-2.11.0/capstone/libcapstone.a' is up to date.
  CC      util/memfd.o
util/memfd.c:44:12: error: static declaration of ‘memfd_create’ follows non-static declaration
 static int memfd_create(const char *name, unsigned int flags)
            ^~~~~~~~~~~~
In file included from /usr/include/bits/mman-linux.h:117:0,
                 from /usr/include/bits/mman.h:49,
                 from /usr/include/sys/mman.h:41,
                 from /soft/qemu-2.11.0/include/sysemu/os-posix.h:29,
                 from /soft/qemu-2.11.0/include/qemu/osdep.h:104,
                 from util/memfd.c:28:
/usr/include/bits/mman-shared.h:46:5: note: previous declaration of ‘memfd_create’ was here
 int memfd_create (const char *__name, unsigned int __flags) __THROW;
     ^~~~~~~~~~~~
make: *** [/soft/qemu-2.11.0/rules.mak:66: util/memfd.o] Error 1

解决方案

修改报错的文件memfd.c
vim qemu-2.11.0/util/memfd.c

将第43行
static int memfd_create(const char *name, unsigned int flags)
修改为
int memfd_create(const char *name, unsigned int flags)

保存退出
make clean
make
编译成功
在这里插入图片描述

  • 10
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值