Building FLTK 1.3.3 with MSYS/MinGW on Windows 8.1
Downloading the compiler and FLTK sources
- Download the MinGW and MSYS installer (usually called mingw-get-setup.exe) from here (SourceForge)
- Download the FLTK source from here
Setting our environment variables
- Make sure the MinGW bin directory is the FIRST DIRECTORY listed on your System Environment Variable
- Completing the above process will help you avoid any possible conflicts during the build process
Extraction and building
- If you don't know how to extract a tar.gz file there is a guide here (nixCraft)
- Start the MinGW prompt (C:\MinGW\msys\1.0\msys.bat), cd to the directory where you extracted the FLTK source and type the following...
make configure
./configure --enable-gl --enable-threads --enable-shared --enable-localjpeg --enable-localzlib --enable-localpng
make
test/demo
make install
Ensuring a completely static build
- Now find the fltk-config file (which is usually located at C:\MinGW\msys\1.0\local\bin) and add the following at the location shown...
- -static-libgcc and -static-libstdc++
- These modifications will ensure that your applications built with FLTK will have no unnecessary dependencies
Extra compilation commands for building OpenGL programs
- If you want to use OpenGL you'll need to have #define HAVE_GL 1 at the beginning of your program file
- You'll also need to add --use-gl on your command-line too
- So the following will be used to compile an OpenGL example called gl_example.cxx
- fltk-config --use-gl --compile gl_example.cxx