title: C++ multilevel inheritance - Calling Base Constructor Error
body: <p>So I have a fairly complex programm that I dont whant to go into right now. I will include a toy example of the same process and then go over it in more detail. </p>
  
  <p>In my Programm I encounter the Error <code>constructor for 'Hunter' must explicitly initialize the base class 'WorldObject' which does not have a default constructor</code> with multilevel inheritance: <code>WorldObject</code> -> <code>Creature</code> -> <code>Hunter</code>.</p>
  
  <p>To recreate the same structure I made the following:</p>
  
  <pre><code>class Base
  {
  protected:
      int a;
  public:
      Base(int a): a(a) { print("Base contructed"); }
      ~Base() { print("Base destroyed"); }
      virtual void printData() = 0;
  };
  
  
  
  class Derived1 : public Base
  {
  protected:
      int b;
  public:
      Derived1(int a, int b): b(b), Base(a) { print("Derived1 contructed"); }
      ~Derived1() { print("Derived1 destroyed"); }
  };
  
  
  class Derived2 : public Derived1
  {
  protected:
      int c;
  public:
      Derived2(int a, int b, int c) : c(c), Derived1(a, b) { print("Derived2 contructed"); }
      ~Derived2() { print("Derived2 destroyed"); }
      virtual void printData(){ //... }
  }; 
  </code></pre>
  
  <p>Here, the constructor of Derived2 class created Derived1 via the initializer list and this in turn constructs Base "indirectly". This works like I expected. </p>
  
  <p>However, in my complex Code, the Hunter class needs to explicitly call the WorldObject constructor. This looks like:</p>
  
  <pre><code>Hunter(sf::Texture &amp;texture, float x, float y, sf::Font&amp; font) : 
          WorldObject(texture,x, y, font),
          Creature(texture, x, y, font)
      { //... }
  </code></pre>
  
  <p>Here, The Creature constructor just passes every argument to the WorldObject constructor. WorldObject only has this constructor:</p>
  
  <pre><code>WorldObject(sf::Texture&amp; texture, float x, float y, sf::Font&amp; font) : m_sprite(texture)
  { //... }
  </code></pre>
  
  <p>and the used Creature constructor looks like this:</p>
  
  <pre><code>    Creature(sf::Texture &amp;texture, float x, float y, sf::Font&amp; font) : 
      WorldObject(texture, x, y, font), 
      NN(n_input_units, n_hidden_units, n_output_units)
  { //... }
  </code></pre>
  
  <p>Why do I need to initialize both WorldObject and Creature directly in my Programm, but in the toy example it works without the explicit Base constructor? </p>
  
  <p>(( The pre-compiler is also complaining that there is no default constructor for WorldObject, and on compiling the above error appears))</p>