[英]My kbhit() is not Working On Mac, Making a PingPong Game
I am trying to build a ping-pong game on my mac using C++14 (g++ in terminal) and I am getting this error: 我正在尝试使用C ++ 14(终端中的g ++)在我的Mac上构建一个乒乓游戏,并且出现此错误:
use of undeclared identifier 'kbhit'
here is the code: https://github.com/DemonJAZ/GamesC 这是代码: https : //github.com/DemonJAZ/GamesC
The function is in GameManager
, class named Input
. 该函数位于
GameManager
名为Input
类中。
Since there is no sentence with a squiggly mark in the end, I took a liberty to invent a couple of my own. 由于最后没有句子带有弯曲的标记,所以我自由地发明了自己的几个。
Why am I getting this error?
为什么会出现此错误?
There is no kbhit
function in the C++ language. C ++语言中没有
kbhit
函数。
Why am I seeing people using it all over the place?
为什么我看到人们到处使用它? Why does it work for them?
为什么对他们有用?
They are using it on Windows. 他们正在Windows上使用它。 It's a Windows function.
这是Windows功能。 You are on Mac OS X.
您使用的是Mac OSX。
I like to be able to use this function.
我喜欢能够使用此功能。 What should I do?
我该怎么办?
There are several options. 有几种选择。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.