Trouble Including / Using GLM library

yngum's suggestion lead me to look more closely at the documentation, and I realised that glm::translate is actually part of a module that extends the glm core. I needed to include both the glm core and the matrix_transform extension:

#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"

Now the test example works. (I also noticed that I had also made a silly mistake in the test which would have prevented it from compiling. That has been fixed in the original question now for the sake of future readers who may experience the problem I had for the same reason.)


make sure you have the correct arguments or use an IDE to simplify your life.
here are the glm::translate signatures I can find

detail::tmat4x4<T> translate (detail::tmat4x4<T> const &m, detail::tvec3<T> const &v);
detail::tmat4x4<T> translate (T x, T y, T z)
detail::tmat4x4<T> translate (detail::tmat4x4<T> const &m, T x, T y, T z)
detail::tmat4x4<T> translate (detail::tvec3<T> const &v)

Maybe Im a bit late but instead of

#include "glm/glm.hpp"

one could use

#include "glm/ext.hpp"

Tags:

C++

Glm Math