電子書籍の厳選無料作品が豊富!

下のようなディレクトリ中のファイルを出力するプログラムを作りました

#include <sys/types.h>
#include <dirent.h>
#include "ourhdr.h"

int
main(int argc, char *argv[])
{
DIR*dp:
struct direct *dirp;

if (argc != 2)
err_quit("a single argument (the directory name) 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);
}

windowsのcygwinでコンパイラしようとしたのですが、
ourhdr.h : NO such file or directory
のように表示されコンパイルできません。どうすれば、コンパイルできるようになるのか教えてください。

A 回答 (2件)

ourhdr.hがないという警告です。


ourhdr.h という名称のファイルがあるはずですので、
それを、このソースファイルと同じディレクトリ下に
格納しておいてください。
    • good
    • 0

>ourhdr.h : NO such file or directory



エラーメッセージのとおりですよ。「ourhdr.hが見つかりません。」
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!