最近学习Linux C (ubuntu),编译代码时遇见报错,找不到
stat.h
types.h
(ubuntu命令)#gcc -0 open_file open_file.c
....... stat.h: No such file or directory
....... types.h: No such file or directory
然后我去/urs/include/ 目录下去查看了一下,
发现并没有stat.h 和types.h这两个头文件,然后我用命令查找了与这两个头文件相似的头文件,
然后发现了
*****ustat.h
nl_types.h*****
然后把代码里两个头文件(stat.h ,types.h)改成了ustat.h,nl_types.
然后就运行成功了。