title: C++ inheritance: Can't access private element of base class
body: <p>I have a base class:</p>
  
  <pre><code>class Base
  {
  public:
      functions...
  private:
      std::vector&lt;float&gt; privateElement;
  }
  </code></pre>
  
  <p>and  a derived one:</p>
  
  <pre><code>class Derived : public Base
  {
  public:
      functions...
      Derived(anotherElement) : privateElement(anotherElement)
      {
  
      }
  }
  </code></pre>
  
  <p>My problem now is that everytime I try to build my project, the compiler (gcc 4.7.2) always complains about not being able to access <code>privateElement</code>, like:</p>
  
  <pre><code>class Derived does not have any field named privateElement
  std::vector&lt;float&gt; Base::privateElement is private
  </code></pre>
  
  <p>May anybody help me here?</p>