ghosind/HariboteOS

#include <stdio.h> 编译报错

Closed this issue · 1 comments

在day 5的时候,我看您加了lib。但是我在编译stdio.c的时候会报这样的错误

x86_64-elf-gcc -Wall -m32 -fno-pie stdio.c stdio.bin
stdio.c:2:10: fatal error: stdio.h: No such file or directory
2 | #include <stdio.h>
| ^~~~~~~~~
compilation terminated.

查了一下因为x86_64-elf-gcc 并不支持 stdio.h 请问您是如何解决的

Hi,
可以参考Makefile文件中的内容,我在编译的时候添加了-I./libc/include参数设定了头文件目录的位置。