title: invalid new-expression of abstract class type
body: <p>I am currently writing a raytracer for a university class.
  In order to load Scenes from files I wrote an sdfloader to read sdf files and create scenes therefor.</p>
  
  <p>if I now want to compile the loader i get the following error:</p>
  
  <pre><code>rc/sdf_loader.cpp: In member function 'void SDFloader::add_shape(std::istringstream&amp;)':
  src/sdf_loader.cpp:95:58: error: invalid new-expression of abstract class type 'box'
                                  &amp;scene_.materials[mat]));
                                                        ^
  </code></pre>
  
  <p>I tried to find a solution but failed.</p>
  
  <p>The sdf_loader class looks like the following:</p>
  
  <pre><code>class SDFloader {
    public:
      SDFloader();
      ~SDFloader();
  
      Scene const&amp; scene() const;
      void read(std::string file);
  
    private:
      void add_material(std::istringstream&amp;);
      void add_shape(std::istringstream&amp;);
      void add_light(std::istringstream&amp;);
      void add_camera(std::istringstream&amp;);
      void apply_transformation(std::istringstream&amp;);
  
    private:
      Scene scene_;
  };
  </code></pre>
  
  <p>in my implementation of the sdf loader i wrote the method read():</p>
  
  <pre><code>void SDFloader::add_shape(std::istringstream&amp; iss) {
  
      std::string name;
      iss &gt;&gt; name;
  
      if(name == "box") {
        double x1,y1,z1,x2,y2,z2;
        std::string mat;
        iss &gt;&gt; name &gt;&gt; x1 &gt;&gt; y1 &gt;&gt; z1 &gt;&gt; x2 &gt;&gt; y2 &gt;&gt; z2 &gt;&gt; mat;
        scene_.shapes.insert(new box(point(x1,y1,z1),
                                     point(x2,y2,z2),
                                     name,
                                     &amp;scene_.materials[mat]));
      }
  </code></pre>
  
  <p>and for every other shape the same calls.</p>
  
  <p>Where is the Problem in my code? I really don't see it</p>
  
  <p>I am using <code>g++-4.9 - std=c++0x</code> to compile and link everything</p>