title: Undefined reference to 'Class::Class'
body: <p>After fixing the previous problem (see my one other question that I have asked). I had declared more classes.</p>
  
  <p>One of these is called <code>CombatAdmin</code> which does various things: (Header file)</p>
  
  <pre><code>#ifndef COMBATADMIN_H
  #define COMBATADMIN_H
  
  #include &lt;string&gt; // Need this line or it complains
  #include &lt;Player.h&gt;
  #include &lt;Sound.h&gt;
  #include &lt;Enemy.h&gt;
  #include &lt;Narrator.h&gt;
  using namespace std;
  
  class Enemy;
  class Player;
  
  class CombatAdmin // Code yet to be commented here, will come soon.
  {
      public:
          CombatAdmin();
          void healthSet(double newHealth, string playerName);
          void comAdSay(string sayWhat);
          void playerFindsChest(Player *player,Weapon *weapon,Armour *armour);
          void youStoleOurStuffEncounter(Player *player);
          void comAdWarning(string enemyName);
          void comAdAtkNote(string attack, double damage,string target,string aggresor);
          void entDefeated(string entName);
          void comAdStateEntHp(string ent, double hp);
          void comAdStateScanResults(string enemyName, double enemyHealth);
          string doubleToString(double number);
          string intToString(int number);
          bool isRandEncounter();
          void randomEncounter(Player *player,Sound *sound,Narrator *narrator);
          bool combatRound(Player *player, Enemy *enemy, Sound *sound, bool ran);
          void playerFindsItem(string playerName,string itemName,double itemWeight,double playerWeight);
          void playerFindsGold(string playerName,double coinCnt,double playerCoinCnt);
  
  };
  
  #endif // COMBATADMIN_H
  </code></pre>
  
  <p>It is then instanced in the <code>main.cpp</code> file like this: (Snippet of the <code>main.cpp</code> file)</p>
  
  <pre><code>#include &lt;iostream&gt; // Required for input and output
  #include &lt;Item.h&gt; // Item header file.
  #include &lt;Weapon.h&gt; // Header files that I have made for my classes are needed for this program
  #include &lt;sstream&gt; // Needed for proper type conversion functions
  #include &lt;windows.h&gt; // for PlaySound() and other functions like sleep.
  #include &lt;time.h&gt; // Needed to seed the rand() function.
  #include &lt;mmsystem.h&gt; // Not sure about this one, possibly defunct in this program.
  #include &lt;stdio.h&gt; // Needed for a similar kind of output as iostream for various functions error msgs.
  #include &lt;irrKlang.h&gt; // The header file of the sound lib I am using in this program.
  #include &lt;Narrator.h&gt; // The narrators's header file.
  #include &lt;Pibot.h&gt; // Other header files of classes.
  #include &lt;Armour.h&gt;
  #include &lt;Player.h&gt;
  #include &lt;Weapon.h&gt;
  #include &lt;CombatAdmin.h&gt;
  
  using namespace irrklang;
  
  using namespace std;
  
  // Forward referenced functions
  
  
  void seedRandom(); // Seeds the random number so it will be random as apposed to pseudo random.
  string getPlayerName(string temp); // Gets the player's new name.
  
  
  int main(int argc, char* argv[])
  {
      // Variables and object pointers declared here.
      CombatAdmin *comAd = new CombatAdmin(); // Handles combat.
      Narrator *narrator = new Narrator(); // The Narrator that says stuff
      Pibot *piebot = new Pibot(); // PIbot, the player's trusty companion
  
      string temp; // Temp string for input and output
  </code></pre>
  
  <p>However, when I try to compile the project, I get the following error:</p>
  
  <pre><code>C:\Documents and Settings\James Moran.HOME-B288D626D8\My Documents\C++ projects\Test Project\main.cpp|59|undefined reference to `CombatAdmin::CombatAdmin()'|
  </code></pre>
  
  <p>I am using the Code::Blocks IDE (ver 10.05), with the GNU GCC compiler. The project is of type "Console application". I am using windows XP 32 bit SP3.</p>
  
  <p>I have tried changing to search directories to include where the object files are, but no success there.</p>
  
  <p>As can be seen from the code, the narrator and <code>PIbot</code> are instanced just fine. (then used, not shown)</p>
  
  <p>My question is, therefore, what do I need to do to stop these errors occurring? As when I encountered similar "Undefined reference to x" errors before using libraries. I had just forgotten to link to them in Code::Blocks and as soon as I did, they would work.</p>
  
  <p>As this class is of my own making I am not quite sure about this.</p>
  
  <p>Do say if you need more information regarding the code etc.</p>