When I run the code below in Code :: Blocks on Windows. I used fork () to get an error called undefined. I installed / selected the GCC compiler as my default compiler.
#include<stdio.h>
#include<unistd.h>
void main()
{
int x;
x = 0;
fork();
x = 1;
...
....
}
Please help me and tell me, can I use unix / linux programs in Code :: Blocks in Windows environment correctly?
And I'm writing another program,
main()
{
int x = 0;
if(x == 0)
{
printf("X = %d", x);
sleep(1000);//used delay also
x = 1;
printf("Now X = %d", x);;
}
Here it gives eroor that the undefined reference to sleep () and / * delay is also * /.
Please help me.
source
share