关于头文件
用gcc编译一个程序,程序包含了“ourhdr.h”,但出现错误提示,没有这个头文件
#include <sys/types.h>
#include <dirent.h>
#include <ourhdr.h>
int main(int argc,char *argv[])
{
DIR *dp;
struct dirent *dirp;
if (argc !=2)
err_quit("a single argument (the dirname) is required");
if ((dp = opendir(argv[1])) == NULL)
err_sys("can't open %s",argv[1]);
while ((dirp = readdir(dp)) !=NULL)
printf("%s\n",dirp->d_name);
closedir(dp);
exit(0);
}
编译的结果提示如下:list_allfile.c:3:60: ourhdr.h: 没有那个文件或目录
list_allfile.c: In function `main':
list_allfile.c:10: `NULL' undeclared (first use in this function)
list_allfile.c:10: (Each undeclared identifier is reported only once
list_allfile.c:10: for each function it appears in.)
有朋友告诉我这个头文件是APUE里边的头文件
应该怎么重新改写并编译一下呢?