2014-02-16 116 views
1

我相信我做錯了什麼,因爲我想要做的是編譯教程4的opengl教程。我相信我不斷收到很多與GLM有關的錯誤,並需要幫助解決它。 這是我收到的錯誤,當我嘗試編譯它時(我相信我也正確安裝了所有其他的東西):安裝GLM - MinGW 64

規格是mingw 64,windows 7,我知道glfw的作品。不確定是否爲笨拙,但我沒有看到任何問題。我一次又一次地將它放在正確文件夾中的glm頭文件中。

C:\Users\Public\Documents\ACADEMICS\Personal Library\OpenGL-tutorial_v0014_33\Op 
enGL-tutorial_v0014_33\tutorial04_colored_cube>g++ tutorial04.cpp -lmingw32 -lop 
engl32 -lglew32 -lglu32 -lglfw3 -mwindows 
In file included from c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../. 
./../x86_64-w64-mingw32/include/glm/gtc/matrix_transform.hpp:292:0, 
       from tutorial04.cpp:14: 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl: In function 'glm::detail::tmat4x4<T, P> 
glm::rotate(const glm::detail::tmat4x4<T, P>&, const T&, const glm::detail::tvec 
3<T, P>&)': 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl:79:165: note: #pragma message: GLM: rotat 
e function taking degrees as a parameter is deprecated. #define GLM_FORCE_RADIAN 
S before including GLM headers to remove this message. 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl: In function 'glm::detail::tmat4x4<T, P> 
glm::rotate_slow(const glm::detail::tmat4x4<T, P>&, const T&, const glm::detail: 
:tvec3<T, P>&)': 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl:120:170: note: #pragma message: GLM: rota 
te_slow function taking degrees as a parameter is deprecated. #define GLM_FORCE_ 
RADIANS before including GLM headers to remove this message. 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl: In function 'glm::detail::tmat4x4<T, (gl 
m::precision)0u> glm::perspective(const valType&, const valType&, const valType& 
, const valType&)': 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl:253:170: note: #pragma message: GLM: pers 
pective function taking degrees as a parameter is deprecated. #define GLM_FORCE_ 
RADIANS before including GLM headers to remove this message. 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl: In function 'glm::detail::tmat4x4<T, (gl 
m::precision)0u> glm::perspectiveFov(const valType&, const valType&, const valTy 
pe&, const valType&, const valType&)': 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl:285:173: note: #pragma message: GLM: pers 
pectiveFov function taking degrees as a parameter is deprecated. #define GLM_FOR 
CE_RADIANS before including GLM headers to remove this message. 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl: In function 'glm::detail::tmat4x4<T, (gl 
m::precision)0u> glm::infinitePerspective(T, T, T)': 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl:311:178: note: #pragma message: GLM: infi 
nitePerspective function taking degrees as a parameter is deprecated. #define GL 
M_FORCE_RADIANS before including GLM headers to remove this message. 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl: In function 'glm::detail::tmat4x4<T, (gl 
m::precision)0u> glm::tweakedInfinitePerspective(T, T, T)': 
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/include/glm/gtc/matrix_transform.inl:339:185: note: #pragma message: GLM: twea 
kedInfinitePerspective function taking degrees as a parameter is deprecated. #de 
fine GLM_FORCE_RADIANS before including GLM headers to remove this message. 
C:\Users\Richard\AppData\Local\Temp\ccuc6Ups.o:tutorial04.cpp:(.text+0x28c): und 
efined reference to `LoadShaders(char const*, char const*)' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(context.c.obj):context.c:(.text+0x3c): undefined referen 
ce to `glGetString' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(context.c.obj):context.c:(.text+0xab): undefined referen 
ce to `glGetIntegerv' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(context.c.obj):context.c:(.text+0x5c6): undefined refere 
nce to `glGetString' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(context.c.obj):context.c:(.text+0x710): undefined refere 
nce to `glGetIntegerv' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(context.c.obj):context.c:(.text+0x74e): undefined refere 
nce to `glGetIntegerv' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(context.c.obj):context.c:(.text+0x7e2): undefined refere 
nce to `glGetIntegerv' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xa51): undefine 
d reference to `__imp_wglMakeCurrent' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xadd): undefine 
d reference to `__imp_wglGetProcAddress' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xf33): undefine 
d reference to `__imp_wglCreateContext' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0xf5d): undefine 
d reference to `__imp_wglShareLists' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x1186): undefin 
ed reference to `__imp_wglDeleteContext' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x12fd): undefin 
ed reference to `__imp_wglMakeCurrent' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x1326): undefin 
ed reference to `__imp_wglMakeCurrent' 
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw3 
2/lib/../lib/libglfw3.a(wgl_context.c.obj):wgl_context.c:(.text+0x143a): undefin 
ed reference to `__imp_wglGetProcAddress' 
collect2.exe: error: ld returned 1 exit status 

C:\Users\Public\Documents\ACADEMICS\Personal Library\OpenGL-tutorial_v0014_33\Op 
enGL-tutorial_v0014_33\tutorial04_colored_cube> 

回答

1

隨着輸出增加說「的#define GLM_FORCE_RADIANS」刪除GLM警告信息,但是這似乎只是一個警告。

問題出在GLFW上。嘗試在-lglfw3之後移動-lopengl32和-lglu32。 另外,我曾經在構建一些教程時遇到了麻煩(可能與你一樣),因爲他們使用的是不同版本的GLFW。嘗試與GLFW2鏈接。

+0

謝謝你,擺脫了所有的錯誤,所有我留下了一個未定義的GLUint,我現在只是覺得它的教程。它是爲VC開發的,我認爲我可以處理它。 – user3316475