If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

<dirent.h> on MSVC

I have a code that I need to compile and it uses the functions and structs defined in <dirent.h>
I found out that this is not a msvc standard header but I need to use msvc (for other stuff in the project).
So I searched in the internet a lot and could only find the file but now I need to find a .lib or .obj file that contains the functions bodies, and unfortunately I cannot...

Can someone please tell be where I can find this!

thanx a lot for any help

It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames

Re: <dirent.h> on MSVC

Originally posted by SeventhStar
I have a code that I need to compile and it uses the functions and structs defined in <dirent.h>
I found out that this is not a msvc standard header but I need to use msvc (for other stuff in the project).
So I searched in the internet a lot and could only find the file but now I need to find a .lib or .obj file that contains the functions bodies, and unfortunately I cannot...

Forget about trying to find a "dirent.h" for MSVC and just concentrate on the functions that you're trying to call. It's all part of porting your code to another compiler.

You may never find a header file or lib file to call your functions exactly as before, so you use the functions that are available that mimic or closely resembles what the other functions did.

DJGPP and DEV C++ are both windows compilers and both have dirent.h so it does exist for windows

Also are you sure that nobody has ever written a shell to _findfirst(), _findnext() and _findclose() functions that looks just like dirent.h just to make his UNIX and POSIX programs compile without change under windows
(I see someone has done it for windows gnu c compilers but has nobody done it for windows?)

If noone has, it sure will be easier for me to write it than change the code that I already have because, as I said, it's a LOT!

Last edited by SeventhStar; November 21st, 2003 at 03:21 AM.

It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames

Both DJGPP and MingW (the compiler used in Dev-C++) are ports of GCC to Windows and thus include a port of POSIX functions.

The problem is that most ports of POSIX functions to Windows are probably done by people who come from Linux, and thus are likely to be licensed under the GPL. Don't forget: if you use that code your app must be released under the GPL too!

Don't know about MingW's port though, maybe it has an easier license (would make sense in a way). Maybe you can use theirs (or adapt theirs so you can use it).