当我尝试声明一个名为“Game”的类实例时,我收到了编译错误“error: 'Game' does not name a type”(错误:'Game'未命名类型)的主要.cpp文件。
可能并不重要,但我正在使用Codeblocks。
来自Game.cpp的相关代码
#include "../include/main.h"
class Game
{
private:
public:
};
Main.cpp中相关的代码:
#include "../include/main.h"
Game g; //this is the line it is referring to
int main(int argc, char* args[])
{
return 0;
}
我只是开始学习C++,所以可能忽略了一些显而易见的东西:(