www.digitalmars.com         C & C++   DMDScript  

c++ - error "unistd.h is not for Windows use"

reply Kaitlyn <kaitlynallen yahoo.com> writes:
While trying to compile an acoustic ray tracing program with all
program component files in the c:\dm\bin directory I get the following
error:

unistd.h is not for Windows use.

This file is not a component of the program I am trying to compile,
and I did download the windows 32 version of the DM C/C++ compiler.
Is there a way to fix this error?
Feb 14 2009
parent Cesar Rabak <crabak acm.org> writes:
Kaitlyn escreveu:
 While trying to compile an acoustic ray tracing program with all
 program component files in the c:\dm\bin 

Do not do that... put your files in a work directory (preferentially outside the DM directory tree).
 directory I get the following
 error:
 
 unistd.h is not for Windows use.

This means your source files are including it and your trying to build a WIN32 binary.
 
 This file is not a component of the program I am trying to compile,
 and I did download the windows 32 version of the DM C/C++ compiler.

Probably you got sources that were intended to be built in a Unix envinronment and building as WIN32 target.
 Is there a way to fix this error?

If you really must build it as WIN32 target, you have to find all dependencies for this header and replace by the equivalents of the Windows platform. Another option would be to try to build for a extended DOS (32 bit) target.
Feb 14 2009