Note that there are some explanatory texts on larger screens.

plurals
  1. POCompiler Error for unknown reasons (C++)
    text
    copied!<p>I get a compiler error (C2061) in MSVS C++ 2010 IDE, when I try to compile. I simply got no clue as to why it occurs, as I can see no apparant error.</p> <pre><code>#pragma once #ifndef _CCOMPONENT_H #define _CCOMPONENT_H #include "CGame.h" class CComponent { public: CComponent(CGame &amp;game); ~CComponent(); protected: virtual void Draw(); virtual void Update(); virtual void Init(); void Dispose(); }; #endif // _CCOMPONENT_H </code></pre> <p><strong>Compiler Error:</strong></p> <pre><code> ccomponent.h(10): error C2061: syntax error : identifier 'CGame' </code></pre> <p>Contents of CGame.h</p> <pre><code>/************************************************** * * ****************************************************/ #pragma once #ifndef _CGAME_H #define _CGAME_H #include &lt;cstdio&gt; #include &lt;list&gt; //#include &lt;Box2D/Box2D.h&gt; #include &lt;allegro5\allegro5.h&gt; #include "SharedDef.h" #include "CComponent.h" #include "CTestPlayer.h" using namespace std; class CComponent; class CTestPlayer; const int MAX_COMPONENTS = 255; class CGame { public: // CONSTRUCTORS CGame(); ~CGame(); // ACCESSORS ALLEGRO_DISPLAY *GetGameDisplay(); ALLEGRO_EVENT_QUEUE *GetGameEventQueue(); list&lt;CComponent&gt; GetComponents() { return *m_Components; } void AddComponent(CComponent component); bool IsRun(); void StartTimer(); void StopTimer(); virtual bool ShouldDraw(); virtual bool ShouldUpdate(); virtual void Update(void); virtual void Draw(void); virtual void Dispose(); protected: virtual void RegisterEventSources(); virtual void Initialize(); private: bool InitializeAllegro(); private: ALLEGRO_DISPLAY *m_Display; ALLEGRO_EVENT_QUEUE *m_EventQueue; ALLEGRO_TIMER *m_Timer; ALLEGRO_EVENT m_Event; list&lt;CComponent&gt; *m_Components; //CComponent *m_Components[MAX_COMPONENTS]; bool m_bIsRunning; bool m_bShouldDraw; }; #endif // _CGAME_H </code></pre> <p>and, "class CGame" is declared and defined in "CGame.h", so I really cannot see why....</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload