编译错误:“ stdint.h:没有这样的文件或目录”

时间:2020-08-23 09:04:50

标签: c gcc

在尝试构建内核时

我收到此错误

/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 dir下有:limit.h和syslimit.h

1 个答案:

答案 0 :(得分:0)

最后,

我通过添加到KBUILD_CFLAGS += $(call cc-option,-ffreestanding)

解决了该问题

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