Undefined reference to fork() in Code::Blocks editor in Windows OS
No, you can't write Unix code on Windows like that, no matter what IDE you use. However, you should try cygwin, and that should provide the compatibility layer you need.
2017 update: These days we also have Windows Subsystem for Linux.
There is no fork
system call on Windows.
fork()
is a unix system call, so it will definitely produce an undefined reference when you do this in windows OS. Windows does not support fork()
.