0

I'm trying to forward declare the mat4 class from the glm library. I want to create a camera class to handle all of my camera matrix information, but am having trouble writing the head without having to include the glm files in my header.

my header is as follows:

#pragma once

namespace glm
{
    class mat4;
}

class Camera
{
public:
    Camera();
    ~Camera();

private:
    glm::mat4 projection;
    glm::mat4 view;
    glm::mat4 model;
    glm::mat4 MVP;
};

for every member, I get error C2079: 'Camera::[member]' uses undefined class 'glm::mat4'

I really need help. Thank you in advance.

rearden
  • 135
  • 1
  • 1
  • 11
  • You need to provide the class *definitions* before they re used in `Camera`. – juanchopanza Jul 27 '14 at 21:37
  • A forward declaration won't work here; the compiler needs to know the size of `glm::mat4` so that it can calculate the size of `Camera`. –  Jul 29 '14 at 22:34

0 Answers0