Including glm.hpp causes compile error on visual studio

Hi All

My code compiles on xCode but when including glm.hpp in visual studio I get an error (even though I’m not currently using glm.hpp)

Error C2664 ‘glm::detail::storage<T,16,true>::type::type(glm::detail::storage<T,16,true>::type &&)’: cannot convert argument 1 from ‘__m128i’ to ‘const glm::detail::storage<T,16,true>::type &’ GLator h:\dropbox\coding\sdks\gl\glm\detail ype_vec4_simd.inl 400

Any ideas why? I was looking at this similar discussion so I was hoping someone could help me resolve this error. Thank you!

If you just include the glm header without using it, then there are just a few options:

  • there is a mistake in the header (I doubt that, since it is a quiet common lib)
  • the lib uses features (like newer c++ standards) that are not supported by your compiler
  • Your compiler, linker setup is missing something

Since there is an SSE type (__m128i’) in the error message, you might have to add a compiler flag to your build system: