I have a problem to add dirent.h in the project. These days I start to use dirent.h windows API(http://www.softagalleria.net/dirent.php) to read the specific files in the directory in Visual C++ 2008 professional. I wrote a test codes, everything is fine. But if I used in my project(use dirent.h in one of the class), it doesn't work anymore.
If I put #include "dirent.h" in class .cpp file, error messgae shows
fatal error C1083: Cannot open include file: 'dirent.h': No such file or directory
If I put it in class header file, 100 error messages came out. Here is the example.
I see what you mean. It's straight forward to knock up a POSIX style dirent based lib for Windows that doesn't add much overhead, clearly softagalleria.net have tried it, and cygwin do a good job of it too.
The fact is, it's a UNIX specific API. There is a Windows specific equivalent that uses: FindFirstFile()/FindNextFile()/FindClose().
Cause this project is contributed by many people, and we all use Visual C++ 2008. That's why I stick to softagalleria's dirent.h. Otherwise other people still can't compile and use the codes.