On 2005-9-28 19:07 UTC, Juan Jose Costello Levien wrote:
> I would like to know which .a file do I have to reference in order to
> build a source that includes a reference to unistd.h.
General technique for finding which library exports a given function
(here, I chose 'mkdir'):
C:/MinGW/lib$../bin/nm --print-file-name lib*.a |grep mkdir
MinGW may support some of the functions prototyped in <unistd.h> but
From: Tor Lillqvist <tml@ik...> - 2005-09-28 23:25:09
Juan Jose Costello Levien writes:
> I would like to know which .a file do I have to reference in order to build
> a source that includes a reference to unistd.h.
You mean mingw's <unistd.h>, or the <unistd.h> on some Unix system?
Remember that mingw does not provide any more Unix APIs than what the
Microsoft C runtime provides. (Well, actually it does, but only a bit
more, no "difficult" things.) The Microsoft C runtime provides Unixish
functions like open(), read(), close(), but not functions like
getuid(), getegid(), getppid().
Mingw's <unistd.h> exists only to reduce the need for ifdefs in source
code ported to Windows. It includes the headers <io.h> and <process.h>
which are traditional headers provided by Windows C compilers, and
which declare *some* of the same functions that you would have in a
Unix <unistd.h>, but not all by a long shot. (The only function
declared in mingw's <unistd.h> itself is ftruncate().)
You don't need to specify any library (.a file) to get the functions
declared in mingw's <unistd.h> (i.e., <io.h> and <process.h>, they are
in the C runtime which is linked in by default.