安装程序
https://sourceforge.net/projects/mingw/files/Installer/
Installing MinGW and MSYS
Download and run mingw-get-inst
Select "Use pre-packaged repository catalogues".
Review and accept the License agreement.
Please note that MinGW should be installed to a directory path that doesn't contain any spaces. This method has been tested with a directory path of C:\MinGW.
Select C++ Compiler and MSYS Basic System as optional components.
Wait until every package has been downloaded and installation is finished.
Setting up MSYS
Go to your MSYS folder (found at <MinGW installation folder>\msys\1.0, C:\MinGW\msys\1.0 in this example),
open etc\fstab with a text editor (for example Notepad) and add the following line at the end of the file:
C:\MinGW\ /MinGW
C:\MinGW\ /usr/local
启动 MSYS
msys.bat
mingw-get install msys-wget
mingw-get install msys-unzip
mingw-get install msys-patch
====================================================================================================================================
Libraries
ZLIB
Compiling zlib uses a slightly different process.
make -f win32/Makefile.gccBINARY_PATH=/mingw/bin INCLUDE_PATH=/mingw/include LIBRARY_PATH=/mingw/lib
make install -f win32/Makefile.gcc SHARED_MODE=1
OpenSSL
OpenSSL has a slightly more complex build procedure. See their INSTALL
and especially INSTALL.W32
for more information.
./Configure mingw shared no-jpake no-krb5 no-md2 no-rc5 no-static-engine --prefix=/mingw
make depend
makemake install
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)
In the shell:
cd /mingw/bin
pexports libxml2.dll > libxml2.def
dlltool –dllname libxml2.dll –def libxml2.def –output-lib ../lib/libxml2.a