I've been looking around the web about how to make the program wait for a set amount of time and discovered this type of code. However, my IDE says it cannot resolve Sleep(). I have included the appropriate library and even tried its variations. I'm confused about what's wrong and would much appreciate help.
I use the Eclipse IDE patch 4.24
My compiler is MinGW, downloaded from sourceforge.net and said to be last updated 2021-09-05.
I am on Windows 10 Pro.
OS build 19044.1348
I cycled between using the libraries: <windows.h> and <unistd.h>. I found no results.
Edit 1: While continuing experimenting with C++, I've discovered that other symbols such as cout and string have encountered the same problem as with Sleep(); the symbols cannot be resolved.
This was a non-issue before. cout and string were both functional when last used (to elaborate, I'd been using cout since I started coding; I used string and Sleep() together while I was experimenting but Sleep() could not be resolved by the IDE during said experiment and up to this day).
Code:
#include <windows.h> #include <iostream> using namespace std; int main() { sleep(); }
My compiler is MinGW, downloaded from sourceforge.net and said to be last updated 2021-09-05.
I am on Windows 10 Pro.
OS build 19044.1348
I cycled between using the libraries: <windows.h> and <unistd.h>. I found no results.
Edit 1: While continuing experimenting with C++, I've discovered that other symbols such as cout and string have encountered the same problem as with Sleep(); the symbols cannot be resolved.
This was a non-issue before. cout and string were both functional when last used (to elaborate, I'd been using cout since I started coding; I used string and Sleep() together while I was experimenting but Sleep() could not be resolved by the IDE during said experiment and up to this day).
Comment