I am compiling code in Visual Studio 2010that includes a header file unistd.h. Since windows do not support the header file unistd.h, I am looking for an alternative header file or is there a way to configure it so that it can compile it in Visual Studio as well.
Visual Studio 2010
unistd.h
Try including io.h, this is the equivalent of unistd.h in MSVC. if you want to keep compatibility, try the following:
#ifdef _WIN32 #include <io.h> #else #include <unistd.h> #endif
Best of all, instead of trying to pick up the wrong header file on Windows, just delete the line:
#include <unistd.h>
then try and compile your code.
( ), .
, , , , , Windows.
, WindowsUniStd.h( ), , .
GNU unistd.h, MinGW project. , , .
If this is not enough, you transfer the program and you transfer to a bad system. Windows is the compute base providing the full unistd.h is Herculean's task, and you are probably better off rewriting the application to remove links to unistd.h or using Cygwin.