Reputation: 319
I am faced with a OS experiment to develop a Unix shell. In order to create a new process, I have to use the fork()
function. However, the fork()
function is defined in <unistd.h>
, and I can not use it in Microsoft Visual Studio. Is there any way to solve this?
Upvotes: 0
Views: 8089
Reputation: 21514
If you are using Visual Studio, it probably means you are targetting Windows...? fork()
is not part of Windows API, you must then find another way to create a new process:
CreateProcess
on Windows and probably fork
on Linux. Have a look at Boost.Process for instance (but there's probably others, like Qt's QProcessI would personnaly recommand the second approach (I use Boost.Process).
Upvotes: 1