Strange nobody has said anything about this. By default on Windows, the GLEW headers use declspec(dllimport)
for all of the external functions, which mangles all of their names. This is why all of the missing external symbol names all have _imp____
at the front.
If you wan't to use a static build of GLEW (you mentioned something about libglew.a
), define GLEW_STATIC
during the build of GLEW and during the build of your application. This will unmangle the names for static linking.
If you want to link to a shared library version of GLEW, make sure to build GLEW with GLEW_BUILD
. I'm not sure if this is necessary with gcc but it is if the library is built with MSVC.
Furthermore, the GNU toolchain actually supports Microsoft's .lib
format for linking. source
You may find it easiest to just compile GLEW yourself or even include it in your project. It is only one source file and a few headers. To compile the library manually, use something along the lines of gcc -shared -o libGLEW.dll -Wl,--out-implib=libGLEW.dll.a -O2 -DGLEW_BUILD glew.c
. To get the static version use something like gcc -c -O2 -DGLEW_STATIC glew.c
instead.