我学习下一个操作系统课程和刚刚写完这个程序按照教科书说明:GCC致命错误:quit.h没有这样的文件或目录
#include <dirent.h>
#include <stdio.h>
#include "quit.h"
int main(int argc, char **argv) {
DIR *dir;
struct dirent *direntry;
arg_check(2, argc, "Specify a directory\n", 1);
if ((dir = opendir(argv[1])) == NULL)
quit("opendir", 1);
while ((direntry = readdir(dir)) != NULL)
printf("%10d %s\n", direntry->d_ino, direntry->d_name);
closedir(dir);
exit(0);
}
这段代码正好从复制教科书,但quit.h似乎导致编译文件。我尝试将“quit.h”切换为“quit”,但这些都没有奏效,我也找不到有关这个特定问题的其他问题。
文件'quit.h'与C源文件位于同一目录吗? –
或更改问题 - 文件quit.h – pm100
哪本教科书? –