I am having a few problems with creating a new class by copying other objects to it. From what i can see, the code below works, however my compiler states it's missing a default constructor of the class material. From what i can see, this is not needed. Am i doing something wrong here?

First class constructor:

```
    shadingBatch::shadingBatch(const vertexAttribLayout& layout, const material& batchMaterial){
    dataFormat_ = layout;
    batchMaterial_ = *(new material(batchMaterial));
}

```

I have also tried

```
shadingBatch::shadingBatch(const vertexAttribLayout& layout, const material& batchMaterial){
            dataFormat_ = layout;
            batchMaterial_ = batchMaterial;
        }

```

But the same compiler error is returned.

Second class definition

```
    class material {
protected:
    shader shader_;
public:
    material (const shader* shaderProgram);
    material (const material&);
    ~material();

    void compileShader();
} ;

```

Second class copy constructor

```
material::material(const material& other){
        shader_ = *(new shader(other.shader_));
    }

```

Edit: As requested,

First class definition

```
class shadingBatch {
    friend class cheeseRenderer;
protected:
    std::vector<primitive*> primitives_;
    std::vector<vertex> vertices_;
    std::vector<GLuint> elements_;
    vertexAttribLayout dataFormat_;
    material batchMaterial_;
    GLuint VAO_;
    GLuint VBO_;
    GLuint EBO_;
public:
    ~shadingBatch();
    GLuint updateBatch (void);
    void addPrimitive (primitive*);
    shadingBatch(const vertexAttribLayout&, const material&);
private:
    void updatePrimitives (void);
    void setVertexAttributes(void);
} ;

```

And where the constructor is called:

```
shader* defaultShader = new shader(fragmentSource,vertexSource);
material* defaultMaterial = new material(defaultShader);
vertexAttribLayout* defaultVertexData = new vertexAttribLayout();
shadingBatch* batch = new shadingBatch(*defaultVertexData,*defaultMaterial);
cheeseRenderer renderer(*batch);

```