Original version by Trevor Dearham (WhiteKnight)
MinGW And MSYS
Packages Used For MinGW
autoconf-2.59automake-1.9.6
binutils-2.16.91
gcc-core-3.4.4
gcc-g++-3.4.4
gcc-g77-3.4.4
gettext-0.14.1
libiconv-1.9.2
libtool-1.5.20
mingw-runtime-3.9
mingw-utils-0.3
w32api-3.5
Packages Used For MSYS
bison-2.0flex-2.5.4a
perl-5.6.1
MSYS-1.0.11
pkg-config-0.20
Where To Get Packages From
mingw-runtime-3.9
and w32api-3.5
where obtained from MinGW. pkg-config-0.20
can be obtained from GTK+ for Windows. The rest where from the package mingw-install-20050907.tar.gz
obtained from MinGW-install.
-- Link for acquiring pkg-config seems obsolete, fresher link at 2009/10/15 is http://www.gtk.org/download-windows.html
Installing Packages
- Uncompress
mingw-install-20050907.tar.gz
- Move
mingw-runtime-3.9.tar.gz
andw32api-3.5.tar.gz
into themingw-install-20050907/mingw
directory - Delete
ming-runtime-3.8.tar.gz
,w32api-3.3.tar.gz
andzlib-1.2.3-20050723-1.tar.gz
, which are in themingw-install-20050907/mingw
directory - Run
mingw-install-20050907/setup/MSYS-1.0.11-2004.04.30-1.exe
- Yes to the continue with post install question.
- No to the do you have MinGW installed question.
- Run MSYS
- Using MSYS run
mingw-install-20050907/msys/install.sh
- Using MSYS run
mingw-install-20050907/mingw/install.sh
- Uncompress
pkg-config-0.20.zip
into "your MSYS directory"/1.0 e.g.msys/1.0
- Copy
/share/aclocal/pkg.m4
to/mingw/share/aclocal/
- Then similar to Step 4 of this link:
- 1. Create a file
/bin/pkg-config.sh
, with the contents
#!/bin/sh if pkg-config "$@" > /dev/null 2>&1 ; then res=true else res=false fi pkg-config "$@" | tr -d \\r && $res
2. Make a copy of /etc/profile
, in case something goes wrong, and then open /etc/profile
and change line 43 from:
export HOME LOGNAME MSYSTEM HISTFILE
to:
PKG_CONFIG=/bin/pkg-config.sh
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export HOME LOGNAME MSYSTEM HISTFILE PKG_CONFIG PKG_CONFIG_PATH
- 3. Quit msys and then rerun it, so that the environment variables get set.
OGRE Dependencies
Packages Used
For OGRE
Additional Packages For DevIL
Additional Package For cegui
Building Packages
The steps in this section assume that you have uncompressed the relevant package and that you have changed to that directory in MSYS. Also most of these packages, by default, will install to the /usr/local
directory to change this use add --prefix={some directory}
e.g.
--prefix=/mingw
to the configure script. Also note that MinGW, by default, will only read includes that are in the /mingw/include
directory and libraries that are in the /mingw/lib
directory. I will show you how to install to the /usr/local
directory, as then this directory will then contain all the dependencies and as a result you will need to manually copy to the includes and libs to the /mingw
directory or use the -I
compiler option to specify the include file directory and the -L
linker option to specify the link library directory.
The steps in this section also assume that you follow the installation of the packages in the order they are listed below.
Also, it is advisable to only keep the library files you wish to use, so if a particular package creates more that on library file, then delete the ones you don't want, e.g. zlib
creates a static library (-+libz.a+-) and a dynamic link library (-+libzdll.a+- for linking at link time and zlib1.dll
for runtime), so pick which one you want to keep and delete the other.
DevIL
zlib 1.2.3
- Open
win32/Makefile.gcc
and change line 34 from:
CFLAGS = $(LOC) -O3 -Wall
to:
CFLAGS = $(LOC) -mms-bitfields -O3 -Wall
- Run:
mkdir /usr/local mkdir /usr/local/include mkdir /usr/local/lib make -f win32/Makefile.gcc INCLUDE_PATH=/usr/local/include LIBRARY_PATH=/usr/local/lib make -f win32/Makefile.gcc install
jpeg 6b
Run:
./configure CFLAGS=-mms-bitfields make make install-lib
tiff 3.7.4
- 1. Open
jmorecfg.h
from your/usr/local/include
directory. - 1. Change line 161 from
- typedef long INT32
- to
- typedef int INT32
- to make it comply with the MS Windows header files.
- 2. Change line 226 from
#ifndef HAVE_BOOLEAN typedef int boolean; #endif
- to
//#ifndef HAVE_BOOLEAN typedef int boolean; //#endif
- 2. Run
./autogen.sh ./configure CFLAGS=-mms-bitfields CXXFLAGS=-mms-bitfields make make install
Note: Read DevIL
's note before building this library.
libpng 1.2.8
- Get
libpng-1.2.8-mingwPORT.tar.bz2
from MinGW. - Uncompress it to the same directory as
libpng
. - Run:
patch -p1 < mingwPORT/mingwPORT.patch make -f scripts/makefile.mingw CFLAGS=-mms-bitfields make -f scripts/makefile.mingw prefix=/usr/local install
lcms 1.14
- 1. Open
include/lcms.h
and change line 149 from typedef unsigned int DWORD, *LPDWORD;
to:typedef unsigned long DWORD, *LPDWORD;
to make it comply with the MS Windows header files.- 2. Open
msys\1.0\mingw\include\sys\stat.h
and then add the following to line 194
#define S_IXOTH 0000001 #define S_IXGRP 0000010 #define S_IXUSR 0000100
- 3. Run
./configure CFLAGS=-mms-bitfields make make install
libmng 1.0.9
- 1. Open
/usr/local/include/icc34.h
and change line 236 from
typedef u_int8_t icUInt8Number; typedef u_int16_t icUInt16Number; typedef u_int32_t icUInt32Number; typedef u_int32_t icUInt64Number[2];
- to
typedef unsigned char icUInt8Number; typedef unsigned short icUInt16Number; typedef unsigned int icUInt32Number; typedef unsigned int icUInt64Number[2];
- 2. Open
makefiles/makefile.mingw
- 1. Change line 20 from
OPTIONS = -DMNG_NO_CMS -DMNG_ACCESS_CHUNKS -DMNG_STORE_CHUNKS
- to
OPTIONS = -DMNG_FULL_CMS -DMNG_ACCESS_CHUNKS -DMNG_STORE_CHUNKS
- 2. Change line 33 from
- #LCMSLIB=-llcms
- to
- LCMSLIB=-llcms
- 3. Change line 55 from
CFLAGS=$(ZLIBINC) $(JPEGINC) $(LCMSINC) -Wall -O3 -funroll-loops $(OPTIONS) $(ALIGN)
- to
CFLAGS=$(ZLIBINC) $(JPEGINC) $(LCMSINC) -Wall -O3 -funroll-loops $(OPTIONS) $(ALIGN) -mms-bitfields
- 3. Run
make -f makefiles/makefile.mingw make -f makefiles/makefile.mingw install
Note: This make install will install to /mingw
.
DevIL 1.6.7
- Copy
/usr/local/include/lcms.h
to/usr/local/include/lcms/lcms.h
- Change
/usr/local/include/jmorecfg.h
line 161 from:typedef long INT32;
to:typedef int INT32;
to make it comply with the MS Windows header files. - Run
./autogen.sh ./configure CFLAGS=-mms-bitfields make make install
Note: I could only get TIF
to be a supported format was by linking tiff
's dll files, as tiff
's static library files have unresovled externals for zlib and jpeg.
cegui
xerces 2.7.0
- Download the mingw-msys patch from here.
- Put the patch in your
xerces
directory e.g.~/xerces-c-src_2_7_0
. - Go to that directory and run:
patch -p1 < xerces-c-src_2_6_0.patch
- Run
export XERCESCROOT={fill in your path to the base of xerces}
e.g.export XERCESCROOT=/home/Trevor/xerces-c-src_2_7_0
Note: Don't use~
, as it will not resolve to being your home directory. - Then go to
src/xercesc
and run:
./runConfigure -p mingw-msys -c gcc -x g++ -z -mms-bitfields make make install
freetype 2.1.10
Run:
./autogen.sh ./configure CFLAGS=-mms-bitfields make make install
cegui 0.4.1
I could only get this to build with the help of Code::Blocks, which uses MinGW. I couldn't get MinGW to import and export correctly with MSYS, but it did compile it and therefore it should be possible to build cegui with MSYS.
- Download the patch for cegui here and put it in your cegui source directory.
- Using MSYS run the following from your cegui source directory:
patch -p1 < cegui.patch
- Download the latest Code::Blocks project files (CB_mingw_files.zip) from here.
- Extract the Code::Blocks project files to the cegui directory.
- Create a
dependencies
directory inside your cegui source directory and inside that directory create aninclude
and alib
directory. - Copy the contents
freetype
'sinclude
directory andxerces
'ssrc
intodependencies/include
andfreetype
'sobjs\.libs\libfreetype.a
andxerces
'sxerces-c-src_2_7_0\lib\libxerces-c.dll
intodependencies/lib
. - Open
makefiles\win32\CB_Mingw\CEGUI.workspace
with Code::Blocks. - Go to
Build options
ofCEGUIBase
.- Open the
Linker
tab and changefreetype.dll
tofreetype
and addxerces-c
for both build targets. - Open the
Compiler
tab and then the#defines
tab inside and add the follow define, so thatxerces
will be used instead oftinyxml
:CEGUI_WITH_XERCES
- Open the
- Right click on
DirectX9GUIRenderer
and selectActivate Project
and then hold down the crtl and shift keys and then press the down arrow untilDirectX9GUIRenderer
is belowFalagardBase
. Use the sample technique to moveOpenGLGUIRenderer
belowFalagardBase
. This should allow you to only buildCEGUIBase
,TaharezLook
,WindowsLook
andFalagardBase
, as this is all you should need. - Build the workspace.
Note:
- If you get a link error when building
CEGUIBase
which contains the following text:undefined reference to inflate, inflateEnd, inflateReset
andinflateInit2_
, then add open theBuild options
forCEGUIBase
and then theLinker
tab and addzdll
and then copylibzdll.a
todependencies/lib
. - You don't need to build
CEGUISampleHelper
, the samples and the DirectX and OpenGL renderers, and therefore it goes out of the scope of this wiki and therefore above I haven't mention the changes necessary to build them.
OGRE Dependencies Not Already Built
zziplib 0.13.44
I could only get this to build with the help of Code::Blocks, which uses MinGW.
- 1. Import
msvc7/zziplib.sln
into Code - :Blocks.
- 2. Go to the
Build options
and select theDirectories
tab and then theCompiler
tab inside it and then do the following for all build targets. - 1. Add the directory where you have put the include files for
zlib
. - 2. Add
..\zzip
to the directories list. - 3. Open the
Directories
tab'sLinker
tab and then addzlib
's library file for all buld targets. - 4. Open the
Compiler
tab'sOther options
tab and add the following for all build targets -mms-bitfields
- 5. Open
zzip\_config.h
and change line 9 from
#ifndef ZZIP_HAVE_BYTESWAP_H #define ZZIP_HAVE_BYTESWAP_H 1 #endif
- to
//#ifndef ZZIP_HAVE_BYTESWAP_H //#define ZZIP_HAVE_BYTESWAP_H 1 //#endif
- 6. Build the workspace.
ode 0.5
- Open
config/user-settings
.- Change line 14 from:
PLATFORM=unix-gcc
to:PLATFORM=mingw
. - Change line 44 from:
#OPCODE_DIRECTORY=OPCODE
to:OPCODE_DIRECTORY=OPCODE
- Change line 14 from:
- Run:
make configure make ode-lib
Cg 1.4
- Using
MinGW
, go toCg
'slib
directory. - Run:
reimp -c cg.lib
This should create two files, namely cg.def
and libcg.a
.