Linker errors when using OpenGL in Qt
I am trying to use OpenGL with Qt. I followed this example: http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html using the Qt 5 build for msvc2012. As a result, I get the following errors:
- error LNK2019: unresolved external symbol _imp_glClear @ 4 referencing function public: virtual void __thiscall OpenGLWindow :: render (void) "(? render @OpenGLWindow @@ UAEXXZ) D: \ Documents \ Code \ Qt Projects \ qttest2 \ qttest2 \ openglwindow .obj qttest2
- error LNK2001: unresolved external symbol _imp_glClear @ 4 D: \ Documents \ Code \ Qt Projects \ qttest2 \ qttest2 \ trianglewindow.obj qttest2
- error LNK2019: unresolved external symbol _imp_glDrawArrays @ 12 specified in function "public: virtual void __thiscall TriangleWindow :: render (void)" (? render @TriangleWindow @@ UAEXXZ) D: \ Documents \ Code \ Qt Projects \ qttest2 \ qttest2 \ trianglewindow.obj qttest2
- error LNK2019: unresolved external symbol _imp_glViewport @ 16 specified in function "public: virtual void" __thiscall TriangleWindow :: render (void) "(? render @TriangleWindow @@ UAEXXZ) D: \ Documents \ Code \ Qt Projects \ qttest2 \ qttest2 \ trianglewindow.obj qttest2
- error LNK1120: 3 unresolved external D: \ Documents \ Code \ Qt Projects \ qttest2 \ Win32 \ Debug \ qttest2.exe qttest2
I can see it has to do with OpenGL function binding, but I have little knowledge of binding.
I get errors even if I copy the source code from the OpenGLWindow example.
+3
source to share