【问题标题】:Compilation error: “stdint.h: No such file or directory”编译错误:“stdint.h:没有这样的文件或目录”
【发布时间】:2020-08-23 09:04:50
【问题描述】:

尝试构建内核时

我收到了这个错误

/usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:9:26: error: no include path in which to search for stdint.h
 # include_next <stdint.h>

当我查看时 /usr/lib/gcc/x86_64-linux-gnu/7/

只有一个 stdint.h,在 include-fixed 目录下有:limit.h 和 syslimit.h

【问题讨论】:

  • 您的操作系统使用交叉编译器还是“标准”gcc 版本?
  • 在我的操作系统 (ubuntu 18.04) gcc 版本 7.5.0 中,在它使用 gcc 7 的项目中

标签: c gcc


【解决方案1】:

最后,

我通过添加KBUILD_CFLAGS += $(call cc-option,-ffreestanding)解决了这个问题

这限制了 gcc 使用标准 stdint stdint-gcc.h

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-14
    • 1970-01-01
    • 2016-05-21
    • 2012-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多