im pretty sure that you need to include <window.h>.
I used to have the same problem with using Sleep() until i found out about this header file