PDA

View Full Version : GLM extension glm_enable_experimental



technologist
01-14-2018, 07:06 PM
Need assistance from someone to implement the glm_enable_experimental extension for the following program. I thought I had been adding it in the correct place, but still getting the error:



.../include/glm/gtx/string_cast.hpp:27:3: error: #error "GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."

the "fix"


GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/string_cast.hpp>


So why doesn't it work?

Thx in advance

GClements
01-14-2018, 10:10 PM
You forgot the "#define":


#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/string_cast.hpp>

technologist
01-15-2018, 09:02 AM
You forgot the "#define":


#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/string_cast.hpp>


Still:


#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/string_cast.hpp>

error message:



In file included from ..\src\Window.h:21:0,
from ..\src\Window.cpp:1:
C:/minGW/mingw64/x86_64-w64-mingw32/include/glm/gtx/string_cast.hpp:27:3: error: #error "GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
# error "GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
^~~~~

technologist
01-15-2018, 11:42 AM
In file included from ..\src\Window.h:21:0,
from ..\src\Window.cpp:1:
C:/minGW/mingw64/x86_64-w64-mingw32/include/glm/gtx/string_cast.hpp:27:3: error: #error "GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
# error "GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
^~~~~


It seems the Windows.h include needed the GLM_ENABLE_EXPERIMENTAL. I found this not only because the error message said so, but because by commenting out GLM includes in main.cpp, the error was still occurring with NO GLM includes!! So I fixed the Windows.h file and because main.cpp included windows.h I didn't need to uncomment the GLM includes from main, it worked just find from the included Windows.

If someone sees a problem in doing that way, plz let me know.

Modified Window.h:


#define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp> // ...so now that's defined we can import GLM itself.
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/string_cast.hpp>


GLM commented out main.cpp
/*
// Include the GL Mathematics library
#define GLM_FORCE_RADIANS // We must work in radians in newer versions of GLM...
#include <glm/glm.hpp> // ...so now that's defined we can import GLM itself.
#include "glm/gtc/matrix_transform.hpp" // Needed for the perspective() method

#include <glm/gtx/string_cast.hpp>
*/

I also put GLM_ENABLE_EXPERIMENTAL before the Windows.h include in main. Bby itself it fixed nothing.
(This was later omitted and compilation still occured)