Is GLM comparable to GLload and GCC

I am currently building my OpenGL framework and decided to use GLload, mainly to load extensions, but it has the added benefit of checking the correct namespace "gl". Thus, al gl * functions are instead used as gl :: *, for example:

glUniformMatrix4fv(...) // instead of this gl::UniformMatrix4fv(...) // use this 

I also want to use glm, which in my opinion should be as simple as include glm/glm.hpp , and make sure I tell my compiler where to find it. But it looks like this may not be directly compatible with glload, as I get the following errors when I try to compile it.

 In file included from glm/glm/fwd.hpp:32:0, from glm/glm/glm.hpp:91, from src/main.cpp:3: glm/glm/core/type_int.hpp:220:2: error: redefinition of 'struct glm::detail::is_int<long int>' glm/glm/core/type_int.hpp:219:2: error: previous definition of 'struct glm::detail::is_int<long int>' glm/glm/core/type_int.hpp:250:2: error: redefinition of 'struct glm::detail::is_uint<long unsigned int>' glm/glm/core/type_int.hpp:249:2: error: previous definition of 'struct glm::detail::is_uint<long unsigned int>' 

From looking at type_int.hpp you can see that it uses a macro, first with “signed long” and “unsigned long” respectively, and then with “highp_int_t” and “highp_uint_t” (causing this error). These are two types of overrides: "int64" and "uint64", the exact types of which depend on the compiler. Since I use GCC, I believe that I should see these types as "signed long" and "long long."

If I comment on these two lines, everything seems to compile just fine. Of course, I’m sure that sooner or later it will turn out that I broke something by doing this.

A search for similar questions led me to this answer, which basically says that glm does not support creating with -std=C++11 , which is unacceptable to me; but this answer is almost two years old, and the glm site requires full compatibility with C ++ 11.

And for reference, I use gcc version 4.7.3, glm version 0.9.5 (as I pulled from github repo), glload from version 0.4.4 glsdk (I removed all other glsdk "modules", leaving me justglload).

+4
source share
1 answer

Well, there seems to be a problem using version 0.9.5 GLM.

Fortunately, I used the git submodule, so I was able to test version 0.9.4 well enough. Version 0.9.4 seems to work just fine for me.

+1
source

Source: https://habr.com/ru/post/1487697/


All Articles