> 
> **Possible Duplicate:**  
> 
> [Why does my compiler not accept fork(), despite my inclusion of <unistd.h>?](https://stackoverflow.com/questions/9612315/why-does-my-compiler-not-accept-fork-despite-my-inclusion-of-unistd-h) 
> 
> 
> 

> 
> Possible duplicate of: [Why
>  does my compiler not accept fork despite my inclusion of unistd.h](https://stackoverflow.com/questions/9612315/why-does-my-compiler-not-accept-fork-despite-my-inclusion-of-unistd-h)
> 
> 
> 

This program is not working on gcc......and giving an linker error..i.e. undefined reference to fork... 

```
#include<stdio.h>  
#include<stdlib.h>  
#include<unistd.h>    

int main()  
{  
    int a=10;  
    if (a==10 && fork())  
        printf("hello");  
    else  
        printf("world");  

    system("pause");  
    return 0;  
}

```