i made class 'Object' and 'Vector', in the each header file. ('Object' is parent class of 'Vector') and made 'Engine.h' header file that include both class header file.
build was successful. but, if i create 'Object.cpp' file which is empty got error. like this 'Vector.h(7,2): error C2504: 'Object': base class undefined'
could you tell me why 'Object.cpp' file occurs this error?
//Engine.h
#pragma once
#include "Object.h"
#include "Vector.h"
namespace Engine
{
}
//Object.h
#pragma once
#include "Engine.h"
namespace Engine
{
class Object
{
};
}
//Vector.h
#pragma once
#include "Engine.h"
namespace Engine
{
class Vector : public Object
{
};
}
#include <iostream>
#include "Engine.h"
int main()
{
return 0;
}