I have no idea why I'm getting this error except that it has to do with the includes.
Base class header file:
#pragma once
#include "Player.h"
#include "TestObject.h"
#include <glm\glm.hpp>
#include <GL\glew.h>
class GameObject
{
//unrelated code
};
Derived class header file:
#pragma once
#include "GameObject.h"
#include <glm\glm.hpp>
#include <glm\gtc\matrix_transform.hpp>
#include <glm\gtc\type_ptr.hpp>
class Player : public GameObject
{
//unrelated code
};
error message:
Error C2504 'GameObject': base class undefined
And here are the includes for both cpp files:
base:
#include "GameObject.h"
#include "Player.h"
#include <iostream>
#include <glm\glm.hpp>
derived:
#include "Player.h"
#include "GameObject.h"
#include <iostream>
#include <glm\glm.hpp>
GameObject.h
includesPlayer.h
. The first real line of code in the resulting stew isclass Player : public GameObject
, which has not, at that point, been defined. Get rid of your#include "player.h"
in GameObject.h. \$\endgroup\$