I was going to do exactly that, however I was afraid people might actually try to look up the documentation on C functions such as posix() or windows() ;-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2005-11-19
While the compiler is GCC, the C runtime library is Microsoft'd MSVCRT.DLL rather than glib. Moreover, the process model in Win32 is significantly different from that of Linux, so the semantics of fork() are not supported.
If you want to run Linux code on Windows without porting, you need to use the Cygwin Linux emulation layer and toolchain - you can coerce Dev-C++ into using this toolchain, but Cygwin itself is a large download and installation.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, All!
I'm developing the C software with Dev-C++4.9.9.2/gcc 3.4 on the Win XP.
Everthing was good but I met a problem.
fork() function is not noticed in this IDE.
Of course, the same source code was compiled on RedHat linux(gcc 3.2)
My test source is as follows:
include <sys/types.h>
include <unistd.h>
include <stdio.h>
int main(int argc, char *argv[])
{
int pid;
pid = fork();
switch(pid)
{
case -1:
perror("fork failed");
break;
default:
break;
}
return 0;
}
I was going to do exactly that, however I was afraid people might actually try to look up the documentation on C functions such as posix() or windows() ;-)
no fork under windows, use win api
While the compiler is GCC, the C runtime library is Microsoft'd MSVCRT.DLL rather than glib. Moreover, the process model in Win32 is significantly different from that of Linux, so the semantics of fork() are not supported.
If you want to run Linux code on Windows without porting, you need to use the Cygwin Linux emulation layer and toolchain - you can coerce Dev-C++ into using this toolchain, but Cygwin itself is a large download and installation.
Clifford
fork: posix
windows: not posix
fork: not under windows
if you want to create processes or threads there are win32 functions, too. Just check the MSDN or this forum.
Perhaps if the forum were written in Prolog it could answer these questions automatically? ;-)