title: Why i getting unresolved externals error when declaring virtual functions in parent class?
body: <p>I have this parent class:</p>
  
  <pre><code>enum UI_STATE
  {
      UI_STATE_SPLASH_SCREEN,
      UI_STATE_LOGIN_SCREEN,
      UI_STATE_CHARACTER_CREATION_SCREEN,
      UI_STATE_CHARACTER_CHOOSE_SCREEN,
      UI_STATE_LOADING_SCREEN,
      UI_STATE_GAMEPLAY,
      UI_STATE_EXIT_REQUESTED,
      UI_STATE_UNKNOWN
  };
  
  [event_source(native)]
  class UserInterface
  {
  protected:
      MyGUI::Gui *mGUI;
  
  public:
      static UserInterface *Instance;
      UI_STATE UI_CURRENT_STATE;
  
  public:
      UserInterface()
      {
          MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform();
          mPlatform-&gt;initialise(BaseObjects::mWindow, BaseObjects::mSceneMgr);
          mGUI = new MyGUI::Gui();
          mGUI-&gt;initialise();
  
          UI_CURRENT_STATE = UI_STATE_UNKNOWN;
      }
  
      ~UserInterface()
      {
          mGUI-&gt;destroyAllChildWidget();
          mGUI-&gt;shutdown();
  
          delete mGUI;
          mGUI = NULL;
  
          delete Instance;
          Instance = NULL;
      }
  
      virtual void update();
      virtual void GAMEPLAY_SCREEN_ShowTargetBox();
      virtual void GAMEPLAY_SCREEN_HideTargetBox();
  
  ...//some other methods
  }
  
  UserInterface *UserInterface::Instance = NULL;
  </code></pre>
  
  <p>Also have two child classes, one of those is overrides this 3 virtual functions and second do nothing with this 3 functions.</p>
  
  <p>Child 1:</p>
  
  <pre><code>#ifndef GameplayScreenInterface_h
  #define GameplayScreenInterface_h
  
  #include "UserInterface.h"
  #include "ControllableCharacterAdv.h"
  
  class GameplayScreenUserInterface : public UserInterface
  {
  private:
  ...
  
  public:
      GameplayScreenUserInterface()
      {
  ...
      }
  
      void GAMEPLAY_SCREEN_ShowTargetBox()
      {
          ...
      }
  
      void GAMEPLAY_SCREEN_HideTargetBox()
      {
          ...
      }
  
      void update()
      {
          UpdateTargetBox();
          UpdateCharacterBox();
      }
  
      void UpdateCharacterBox()
      {
  ...
      }
  
      void UpdateTargetBox()
      {
          if (...)
          {
              if (...)
              {
              ...
              }
              else if (...)
              {
  ...
              }
              else
              {
              ...
              }
          }
          else
              GAMEPLAY_SCREEN_HideTargetBox();
      }
  };
  
  #endif GameplayScreenInterface_h
  </code></pre>
  
  <p>and Child 2:</p>
  
  <pre><code>#ifndef LoginScreenInterface_h
  #define LoginScreenInterface_h
  
  #include "UserInterface.h"
  #include "NetworkManager.h"
  
  class LoginScreenUserInterface : public UserInterface
  {
  public:
      LoginScreenUserInterface()
      {
  ...
      }
  };
  
  #endif LoginScreenInterface_h
  </code></pre>
  
  <p>And compilation errors :(<br /></p>
  
  <pre><code>Error 9 error LNK1120: 3 unresolved externals
  Error 8 error LNK2001: unresolved external symbol "public: virtual void __thiscall UserInterface::GAMEPLAY_SCREEN_HideTargetBox(void)" (GAMEPLAY_SCREEN_HideTargetBox@UserInterface@@UAEXXZ)
  Error 7 error LNK2001: unresolved external symbol "public: virtual void __thiscall UserInterface::GAMEPLAY_SCREEN_ShowTargetBox(void)" (GAMEPLAY_SCREEN_ShowTargetBox@UserInterface@@UAEXXZ)
  Error 6 error LNK2001: unresolved external symbol "public: virtual void __thiscall UserInterface::update(void)" (?update@UserInterface@@UAEXXZ)
  </code></pre>
  
  <p>Anyone have any idea how to get rid of that errors?</p>