SOLVED
What really helped me was that I could #include headers in the .cpp file with out causing the redefined error.
I\'m new to C++ but I have some p
You have circular references here: Physics.h
includes GameObject.h
which includes Physics.h
. Your class Physics
uses GameObject*
(pointer) type so you don't need to include GameObject.h
in Physics.h
but just use forward declaration - instead of
#include "GameObject.h"
put
class GameObject;
Furthermore, put guards in each header file.
Use include guards in ALL your header files. Since you are using Visual Studio you could use the #pragma once
as the first preprocessor definition in all your headers.
However I suggest to use the classical approach:
#ifndef CLASS_NAME_H_
#define CLASS_NAME_H_
// Header code here
#endif //CLASS_NAME_H_
Second read about forward declaration and apply it.