Skip to content

Instantly share code, notes, and snippets.

@soardex
Created May 20, 2015 09:35
Show Gist options
  • Save soardex/8a372987ac34fabe2803 to your computer and use it in GitHub Desktop.
Save soardex/8a372987ac34fabe2803 to your computer and use it in GitHub Desktop.
Build GLEW in MinGW
# create a file named compile.bat in the **root** directory of the glew build director
# it will create files .a and .dll in lib directory
gcc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -DGLEW_BUILD -o src/glew.o -c src/glew.c
gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll src/glew.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
ar cr lib/libglew32.a src/glew.o
gcc -DGLEW_NO_GLU -DGLEW_MX -O2 -Wall -W -Iinclude -DGLEW_BUILD -o src/glew.mx.o -c src/glew.c
gcc -shared -Wl,-soname,libglew32mx.dll -Wl,--out-implib,lib/libglew32mx.dll.a -o lib/glew32mx.dll src/glew.mx.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
ar cr lib/libglew32mx.a src/glew.mx.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment