4
votes

I have downloaded the timezone database library and am trying to compile it under windows to a DLL. When I do this, I get messages like:

1>c:\javatools\tzinfo\src\private.h(97): fatal error C1083: Cannot open include file: 'sys/wait.h': No such file or directory

and, of course, sys/wait.h is not ANSI C, which is the issue. I seem to recall windows have some near file names to this. Can I get an assist here?

Thanks.

2
What function do you want to call? - Dabbler
What library? How do you compile it? Does it support MSVC at all? If it does most likely you don't build it well. In any case sys/wait.h is POSIX header... Don't expect it to be present on Windows. - Artyom
No idea. included in an include and none of it my code. I poked around and didn't see anything. - Thom
Take the include out and see what happens!! - David Heffernan
Maybe remove the include of those headers and see what the code is attempting to call? - wkl

2 Answers

5
votes

fork(), wait() and waitpid() are defined by the POSIX standard, and Windows is not POSIX-compliant.

In order to have POSIX compliance under Windows, you should compile under Cygwin.

The analogous WinAPI functions are CreateProcess and GetProcessExitCode.

2
votes

If you're looking for the wait() equivalent of MSVS, look no further than WaitForSingleObject().