How to upgrade your MinGW with commonly used libraries
This is a cheatsheet for installing libraries in MinGW, be sure to setup a development environment according to this tutorial first: http://www.multigesture.net/articles/how-to-install-mingw-msys-and-eclipse-on-windows/
Libraries
Zlib
- download zlib-1.2.3.tar.gz
- tar -zxvf zlib-1.2.3.tar.gz
- cd zlib-1.2.3
- ./configure –prefix=/mingw
- make
- make install
- gcc -shared -o /mingw/bin/zlib1.dll -Wl,–out-implib=/mingw/lib/libz.dll.a [!em]*.o
Freetype
- download freetype-2.3.12.tar.gz
- tar -zxvf freetype-2.3.12.tar.gz
- cd freetype-2.3.12
- ./configure –prefix=/mingw
- make
- make install
Curl
- download curl-7.20.0.tar.gz
- tar -zxvf curl-7.20.0.tar.gz
- cd curl-7.20.0
- ./configure –prefix=/mingw
- make
- make install
Freeglut
- download freeglut-2.6.0.tar.gz
- tar -zxvf freeglut-2.6.0.tar.gz
- cd freeglut-2.6.0
- ./configure –prefix=/mingw
- make
- make install
Glew
- download glew-1.5.2.zip
- unzip glew-1.5.2.zip
- cd glew-1.5.2
- make
- make install GLEW_DEST=/mingw
SDL
- download SDL-1.2.14.tar.gz
- tar -zxvf SDL-1.2.14.tar.gz
- cd SDL-1.2.14
- ./configure –prefix=/mingw
- make
- make install
Iconv
- download libiconv-1.13.1.tar.gz
- tar -zxvf libiconv-1.13.1.tar.gz
- cd libiconv-1.13.1
- ./configure –prefix=/mingw –enable-static=yes
- make
- make install
Giflib
- download giflib-4.1.6.tar.gz
- tar -zxvf giflib-4.1.6.tar.gz
- cd giflib-4.1.6
- ./configure –prefix=/mingw
- make
- make install
Jpeg
- download jpegsrc.v8a.tar.gz
- tar -zxvf jpegsrc.v8a.tar.gz
- cd jpeg-8a
- ./configure –prefix=/mingw
- make
- make install
Png
- download libpng-1.4.1.tar.gz
- tar -zxvf libpng-1.4.1.tar.gz
- cd libpng-1.4.1
- ./configure –prefix=/mingw
- make
- make install
Tiff
Be sure to apply the patch for building libtiff
- download tiff-3.9.2.tar.gz
- tar -zxvf tiff-3.9.2.tar.gz
- cd tiff-3.9.2
- ./configure –prefix=/mingw
- make
- make install
Libxml2 (Precompiled)
- Download pexports-0.43.zip
- Unzip pexports.exe to C:/MinGW/bin
- Download libxml2-2.7.6.win32.zip
- Unzip libxml2-2.7.6.win32.zip to C:/MinGW
In the shell:
- cd /mingw/bin
- pexports libxml2.dll > libxml2.def
- dlltool –dllname libxml2.dll –def libxml2.def –output-lib ../lib/libxml2.a
Instructions taken from this site and this site
Boost
- download boost_1_42_0.tar.gz
- tar -zxvf boost_1_42_0.tar.gz
- copy boost dir (with header files) to /mingw/include



April 6th, 2010 at 11:05 pm
./con… doesn’t work on windows ri8?
or is there a way to make it work
April 21st, 2010 at 4:22 am
You need to use msys to compile the libraries. It provides a linux like console and supports ./configure
May 12th, 2010 at 2:53 pm
Hi Laurence,
These instructions are a great help. It has been a long time since I’ve done C++ programming, and what I have done wasn’t advanced. So on to my question…
I’m trying to install zlib. I attempted ./configure…, and I’m getting this message:
$ ./configure -prefix=/mingw
Checking for gcc…
Please use win32/Makefile.gcc instead.
Then I tried:
$ make
Please use ./configure first. Thank you.
Any ideas?
Also, zlib-1.2.3 is not available, but 1.2.5 is. I installed 1.2.5. Is that ok?
Finally, any tips on good books to understand C++ and all this dependency stuff?
May 13th, 2010 at 8:28 pm
Any ideas on the “Please use win32/Makefile.gcc instead” message?
May 13th, 2010 at 8:50 pm
I found this in http://www.gaia-gis.it/spatialite-2.4.0/mingw_how_to.html:
cd zlib123
cp win32/makefile.gcc makefile.gcc
That may be what I need.
May 31st, 2010 at 9:12 am
cp win32/makefile.gcc makefile.gcc doesn’t work at all and I cant find anything that works on the net.
July 13th, 2010 at 6:59 pm
I was able to compile zlib. Here’s what I did:
tar –lzma -xvf
./msys-build-zlib zlib-1.2.5.tar.bz2
patch <
./configure -prefix=/mingw
make
make install
gcc -shared -o /mingw/bin/zlib1.dll -Wl,–out-implib=/mingw/lib/libz.dll.a [!em]*.o
make check
July 13th, 2010 at 7:05 pm
Now I can’t seem to get libtiff to build. Getting a recursive error during link stage (object name conflicts in archive).