If you prefer not to modify the part of code that uses kbhit
, you can apply these preprocessor directives before including any headers to prevent the error:
#define _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE