Building FreeGlut 3.0.0 with MinGW on Windows 8.1

Downloading the Compiler and FreeGlut sources

Setting our environment variables

Environment variables

Extraction and building

FreeGlut Folder

 

Delete some more

 

 Creating a shared library


gcc -w -O2 -c -D_WIN32_WINNT=0x0500 -DWINVER=0x0500 -D_CRT_SECURE_NO_WARNINGS -DNEED_XPARSEGEOMETRY_IMPL -DFREEGLUT_EXPORTS -I..\..\include *.c ..\*.c ..\util\*.c


gcc -mdll -o freeglut.dll *.o -Wl,--enable-stdcall-fixup,--out-implib,libfreeglutdll.a -lopengl32 -lwinmm -lgdi32 -lm

 Creating a static library


gcc -w -O2 -c -D_WIN32_WINNT=0x0500 -DWINVER=0x0500 -D_CRT_SECURE_NO_WARNINGS -DNEED_XPARSEGEOMETRY_IMPL -DFREEGLUT_STATIC -I..\..\include *.c ..\*.c ..\util\*.c


ar -rcs libfreeglut.a *.o

Placement of files

Compiling an example

FreeGlut Fractal Example

Fractals shared build


gcc -c -O2 fractals.c -DFREEGLUT_EXPORTS


gcc -o fractals.exe *.o -lfreeglutdll -lopengl32 -mwindows

Fractals static build


gcc -c -O2 fractals.c -DFREEGLUT_STATIC


gcc -o fractals.exe *.o -lfreeglut -lopengl32 -lwinmm -gdi32 -mwindows

Koch Snowflake

 

Valid HTML5