Why does my compiler not accept fork(), despite my inclusion of ?

unistd.h and fork are part of the POSIX standard. They aren’t available on windows (text.exe in your gcc command hints that’s you’re not on *nix).

It looks like you’re using gcc as part of MinGW, which does provide the unistd.h header but does not implement functions like fork. Cygwin does provide implementations of functions like fork.

However, since this is homework you should already have instructions on how to obtain a working environment.

Leave a Comment