我在这里做错了什么?
应用程序.h
#pragma once
namespace App{
enum class AppStatus{
Exit,
Menu,
Run
};
void frameLoop();
AppStatus state;
}
应用程序.cpp
#include "App.h"
#include "stdafx.h"
#include <Graphic\Graphic.h>
void App::frameLoop()
{
while (state != AppStatus::Exit) {
Graphic::renderingSequence();
}
}
错误
Error C2653 'App': is not a class or namespace name App
Error C2065 'state': undeclared identifier App
Error C2653 'AppStatus': is not a class or namespace name App
Error C2065 'Exit': undeclared identifier App
请注意,我的命名空间Graphic
(在 \Graphic\Graphic.h 中声明)正在被编译器识别,即使我以同样的方式声明它。