I have some pretty basic code that I wouldn’t think would cause problems:
#include <glm/ext.hpp>
...
mat4x4 m = mat4x4(1.0f);
m = rotate(m, (float) glfwGetTime(), vec3(0.0f, 0.0f, 1.0f));
mat4x4 p = glm::ortho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
mat4x4 mvp = mat4x4(0.0f);
mvp = m * p;
but I get an error on the line mvp = m * p
The error looks like a problem with the template constructor when doing operator*
, and when I remove the multiplication, the program compiles just fine.
In file included from libglm-1.0.0/glm/./ext/../detail/.././ext/matrix_double4x4.hpp:5,
from libglm-1.0.0/glm/./ext/../detail/../mat4x4.hpp:5,
from libglm-1.0.0/glm/./ext/../detail/../matrix.hpp:29,
from libglm-1.0.0/glm/./ext/../detail/type_mat2x2.inl:1,
from libglm-1.0.0/glm/./ext/../detail/type_mat2x2.hpp:176,
from libglm-1.0.0/glm/./ext/matrix_double2x2.hpp:5,
from libglm-1.0.0/glm/mat2x2.hpp:5,
from libglm-1.0.0/glm/glm.hpp:120,
from libglm-1.0.0/glm/ext.hpp:9,
from srcmain.cpp:4:
libglm-1.0.0/glm/./ext/../detail/.././ext/../detail/type_mat4x4.inl: In instantiation of 'constexpr glm::mat<4, 4, T, Q> glm::operator*(const glm::mat<4, 4, T, Q>&, const glm::mat<4, 4, T, Q>&) [with T = float; glm::qualifier Q = (glm::qualifier)0]':
srcmain.cpp:139:19: required from here
libglm-1.0.0/glm/./ext/../detail/.././ext/../detail/type_mat4x4.hpp:13:9: note: 'struct glm::mat<4, 4, float, (glm::qualifier)0>' has no user-provided default constructor
struct mat<4, 4, T, Q>
^~~~~~~~~~~~~~~
I’m compiling glm version 1.0.1 with g++ on Windows. Has anyone seen this error before?
I’ve tried including a bunch of different headers. I also tried version 1.0.0 of glm. Tested without the multiplication, which compiles correctly.