Error, when including ofApp.h more than once

no matter in what class i try to include ofApp.h it gives an error before compiling, not sure if there is a reason for this, but seems like a big to me, since I have used proper guards, in all header files.

are you using “#pragma once” ?

this is surely a forward declaration problem. you can’t include 2 files recursively. for that you need to include one from another and then forward declare in the other header and include in the cpp. look for forward declaration here in the forum or just google it, it’s been answered several times.

in any case, including ofApp from other classes isn’t a very good pattern, it’s usually your app that calls other objects not the other way around

For this problem, I prepared a base class (let’s name ofCanvas.h). This class has the same structure as ofApp.h. All other classes extend this ofCanvas.

I have a MenuCanvas class (it also extends ofCanvas class). ofApp starts this MenuCanvas. I access all other classes (GameCanvas, SettingsCanvas, AboutCanvas, etc…) from the MenuCanvas.