This question already has answers here:
What is the equivalent to getch() & getche() in Linux?

(6个答案)


9个月前关闭。




我在clang-7上使用16.04.1-Ubuntu LTS
我收到此警告:

warning: implicit declaration of function 'getche' is invalid in C99
[-Wimplicit-function-declaration]

随后出现此错误:
error: undefined reference to 'getche'`

有什么事吗

这是我的代码的链接:

https://repl.it/@kallyas/Employees-Record-System

最佳答案

getche()<conio.h>库,因此它是Windows特定的,对于替代方法,您可以查看What is the equivalent to getch() & getche() in Linux?

关于c - 为什么我得到对 `getche'的错误 undefined reference ? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/61427836/

10-10 16:09