It's been asked quite alot before: How do I compile the GLEW 1.7.0 source on Windows with MinGW? The goal being to dynamically link against the library from a c++ project.
More Info: I'm working with QtCreator, ergo use qmake for building. I'm on Windows 7. By now I have tried / had a look at the following links.
use posted batch file also tried to replace gcc with g++
static with vc++ libs, build dll.a reuse vc++ .dll
simple stuff using GLEW msvc++ binaries, works on my desktop
Unfortuantely all posted solutions end in the following error messages for me, when I use the compiled results in my project:
undefined reference to `glDrawElements@16'
debug/Ex04.o: In function `Z6initGLv':
undefined reference to `glClearColor@16'
undefined reference to `glEnable@4'
debug/Ex04.o: In function `Z8updateGLv':
undefined reference to `glClear@4'
undefined reference to `glViewport@16'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [debug/ecg4.exe] Error 1
mingw32-make.exe: *** [debug] Error 2
I'm at the end of my wits regarding this issue. I've double and triple checked the LIBS path in qmake and the windows path variable to include the directory where the glew dll's live. Also qmake's INCLUDEPATH should be fine. Here the paths in the .pro file anyways:
LIBS += -L$$quote(C:/mypath/freeglut/lib/) -lfreeglut
LIBS += -L$$quote(C:/mypath/glew-1.7.0/lib/) -lglew32 -lglew32mx
#LIBS+= C:/mypath/glew-1.7.0/lib/libglew32.dll.a
#LIBS+= C:/Programming/glew-1.7.0/lib/libglew32mx.dll.a
#includepath for project and the required libraries
INCLUDEPATH += ./include
INCLUDEPATH += "C:/mypath/glew-1.7.0/include"
INCLUDEPATH += "C:/mypath/freeglut/include"
So is there someone out there who could give a foolproof set of instructions about how to get the GLEW 1.7.0 source compiled with MinGW?