I have a small problem at the moment. I am writing an program which parses some information from a file but I want to fork the program. I am using pelles but it will not allow me to use this command.
Here is an example program which uses fork. I have tried compiling this but it doesn't work. I know that this code works because I have compiled it with gcc and it executes perfectly on linux.
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#define MAX_COUNT 200
#define BUF_SIZE 100
void main(void)
{
pid_t pid;
int i;
char buf[BUF_SIZE];
fork();
pid = getpid();
for (i = 1; i <= MAX_COUNT; i++) {
sprintf(buf, "This line is from pid %d, value = %d\n", pid, i);
write(1, buf, strlen(buf));
}
}
Any Idea how I can get this to work with windows?
Here is the error that I get
- - - - - - - - - - Yag.exe - - - - - - - - - -
Building Yag.exe.
POLINK: error: Unresolved external symbol '_fork'.
POLINK: fatal error: 1 unresolved external(s).
*** Error code: 1 ***
Done.