I’m using eclipse and I’m building a simple program, but I get an error saying function sleep could not be resolved
#include <time.h>
#include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
printf("ciao");
sleep(20);
return 0;
}
I don’t know if I need other libraries or something else.
MinGW should be installed properly, so I have no idea
If you are using MinGW as stated, then you may need to include
windows.h. The sleep implementation I think uses the Win APISleep().For example: