C++ ‘;游戏运行’;未在此范围中声明

C++ ‘;游戏运行’;未在此范围中声明,c++,linux,conditional,C++,Linux,Conditional,这就是我正在做的,在第五行我得到了这个错误: “gameRunning”未在此作用域中声明 有人知道这个问题吗?这将修复错误: bool gamerunning = true; while (gamerunning) while (SDL_PollEvent(&event)) if (event.type == SDL_QUIT) gameRunning = false; bool gamerunning=true; 同时(游戏

这就是我正在做的,在第五行我得到了这个错误:

“gameRunning”未在此作用域中声明


有人知道这个问题吗?

这将修复错误:

bool gamerunning = true;
while (gamerunning)
         while (SDL_PollEvent(&event))
        if (event.type == SDL_QUIT)
            gameRunning = false;
bool gamerunning=true;
同时(游戏运行)
{
while(SDL_事件和事件))
{
if(event.type==SDL\u QUIT)
{

Galununn=假;/C++是对你的第五行的GAMununn的改变。“丹尼尔,回答它:”哦,我的上帝不能相信我犯了这样愚蠢的错误!!“我敢肯定你知道答案,继续写下去吧!我不想用答案指出错误的答案来玷污我的答案:D OCD警戒。”丹尼尔,NAH,我是WA。正在修复格式:)
bool gamerunning = true; 

while (gamerunning)
{
  while (SDL_PollEvent(&event))
  {
    if (event.type == SDL_QUIT)
    {
      gamerunning = false;  // <--- fixed spelling
    }
  }
}