/home/eric/Desktop/DELTA sim/main.c:376: warning: implicit declaration of function ‘kbhit’
/home/eric/Desktop/DELTA sim/main.c:377: warning: implicit declaration of function ‘getch’
Here's the real message you need to understand.
An "implicit declaration" is very bad.
Edit: It means the compiler guesses what it should mean using the default prototype of an function.
Which means it defaults to returning an int and to taking no parameters for most old,the ones I learned on 25 years ago, C compilers. No idea how GCC defaults.
You need to include the header that defines these functions in an explicit manner.
I would guess adding this line(s) to top of main.c is the correct solution/next step.
or
#define MAIN
#include "kbhit.h"
Note: the define of MAIN is a guess on my part; based on other people code. Only one of the times the header "kbhit.h" is include tends to define MAIN.
Sometimes it is the main.c file and sometimes the kbhit.c file. In rare cases it could be both.
Tim S
#ifdef MAIN
#define EXTERN // the Main module defines objects
#else
#define EXTERN extern // others modules see objects as externs
#endif
The above code means normally define EXTERN as extern; but, in the Main module define it as nothing.
Sometimes the Main modules is the code holding the main() and sometimes it is the "c" file that goes with header.
I am guessing that since you are having issues with kbhit.c errors; that in this case MAIN needs to be defined there. But, it is just a guess!
Where are you defining MAIN?
Tim S