title: C++ Undeclared Identifier (but it is declared?)
body: <p>I'm pretty sure I've included the qanda class, but when I try to declare a vector that contains it or a class of that type I get an error saying that qanda is undefined. Any idea what the problem might be?</p>
  
  <p>bot_manager_item.h</p>
  
  <pre><code>#pragma once
  
  #include "../bot_packet/bot_packet.h"
  #include &lt;vector&gt;
  
  class bot_manager_item;
  #include "qanda.h"
  #include "bot_manager.h"
  
  class bot_manager_item
  {
  public:
      bot_manager_item(bot_manager* mngr, const char* name, const char* work_dir);
      ~bot_manager_item();
  
      bool startup();
      void cleanup();
      void on_push_event(bot_exchange_format f);
      bool disable;
  
  private:
      void apply_changes();
      bot_manager *_mngr;
  
      std::string _name;
      std::string _work_dir;
      std::string _message;
      std::string _message_copy;
      std::vector&lt;qanda&gt; games;
      qanda test;
  
      char _config_full_path[2600];
  };
  </code></pre>
  
  <p>qanda.h</p>
  
  <pre><code>#ifndef Q_AND_A
  #define Q_AND_A
  
  #include "users.h"
  #include "..\bot_packet\bot_packet.h"
  #include "bot_manager.h"
  #include &lt;string&gt;
  #include &lt;algorithm&gt;
  #include &lt;map&gt;
  #include &lt;vector&gt;
  #include &lt;fstream&gt;
  
  
  class qanda
  {
  public:
      qanda(bot_manager * manager, std::string name, std::string directory);
      ~qanda(){};
      void room_message(std::string username, std::string user_message);
      void timer_tick();
  
  private:
      // data members
      std::string question;
      std::string answer;
      std::string directory;
      std::string command_prefix;
      std::string name;
  
      Users users;
      std::map &lt;std::string, std::string&gt; questions_and_answers;
  
      int time_per_question; // seconds
      int time_between_questions; // seconds
      int timer; // milliseconds
  
      bool is_delayed;
      bool is_playing;
  
      bot_manager * manager;
  
      // functions
      void new_question();
      void send_message(std::string msg);
      void announce_question();
      void load_questions();
  
  };
  
  #endif
  </code></pre>
  
  <p>Solved: I ended up refactoring the code in such a way as to avoid the use of bot_manager within the qanda class.</p>