As you know the getch() and getche() functions don’t work with the cygwin, a linux oriented one.
But can I include the conio.h header file of borland c and call the functions getch in my makefiles?
Will it work and can anyone tell me how to include the header files from different directories in cywgin.
I have a header file strcal.h in directory c:/makk/string/.
How do I include that header file in my makefile?
gcc -I/string small.c
It is not working and my current directory is makk.
In
stdio.h, there is agetchar()function which is what you need. You can’t just bring across the Borland header file since that just declares the function, it doesn’t define it. Standard C has no need forgetch().To include header files in different areas, you use the
-Idirectives ofgccto set up search paths.So, if you have a
/xyz/myheader.hfile, you can do something like:To get at
c:/makk/string/strcal.h, you may have to usegcc -I /cygdrive/c/makk/stringor, if you know you’re actually in thatmakkdirectory, you can use-I string(note the lack of leading/since you want a relative path, not an absolute one).