Donations
Help us to pay our Server!
(: Consider a donation :)
Donation pic
Donators
Main Menu
Language
Recent changes

[Main Page]

Building Widelands under Windows

From Widelands.org

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy

Contents

Building widelands under Windows (MinGW)

This page is about building widelands for win32-sytems (Like MS Windows XP or MS Windows 2k, ReactOS, etc). It describes, what you have to do, to get widelands compile under MinGW.


Installing MinGW

MinGW is an minimal, unix-like environment, for building programs with gcc under Windows-systems. For installing a complete new mingw follow the instructions below. Get

In the installation of MinGW, the setup will ask you, which packages you want to be installed. The best would be, if you use the "current"-packages. The following packages are needed for widelands-compile:

  • MinGW base tools


Installing MSYS

Install the MSYS (e.g. D:\MinGW\msys). After the installation a command prompt will pop up and ask you some questions:

Do you wish to continue with the post install? -> press y
Do you have MinGW installed? -> press y
Where is your MinGW installation? -> d:/mingw (note the slash instead of usual backslash!).

Because MinGW uses an older gcc version which causes trouble and a missing make you have to download

and extract them into <yourmingwfolder> overwriting any files. Furthermore, you can get

which isn't used in compile. But can be useful afterwards, if you want to chase bugs :-)!

Installing the needed libraries

After installing MinGW and MSYS, you need to install all libraries and programs, which are needed by widelands.
Here is a list of these files:

Precompiled Packages

SDL Packages

download and unpack them into a temporary folder and move over the directories for each package into <yourmingwfolder>
(e.g. you extracted SDL_image-devel-1.2.6-VC8.zip into D:\tmp. Now go into D:\tmp\SDL_image-1.2.6 and move over the directories into <yourmingwfolder>)

boost Package

download and unpack into a temporary folder. go to Boost\include\boost_1_34_1 and move over the boost directorie into <yourmingwfolder>\include

gettext and iconv Packages

download and unpack them into a temporary folder. You will have usr/local dir and more subdirectories. Move over those subdirectories into <yourmingwfolder>.

zlib package

download and extract these directly into <yourmingwfolder>

Python (only needed for locales)

If you want to compile the locales download python and install it (e.g. to C:\Python). To use it you will need to set one environment variable. This is easy in Windows XP. Right Click

My Computer > Properties > Advanced > Environment Variables > System Variables > Path > Edit

Directories in the Path are separated by semicolons, so append ;C:\Python to your Path. Do not erase any part of your Path under any circumstances. Then bonk OK.

Packages needed to compile

We recommend creating <yourmingwfolder>/src for these packages

libpng

download and unzip it to <yourmingwfolder>/src, go with msys in its folder and run

./configure --prefix=/mingw
make
make install
SDL

download and unzip it to <yourmingwfolder>/src, go with msys in its folder and run

make install-sdl prefix=/mingw
SDL_gfx

download and unzip it to <yourmingwfolder>/src, go with msys in its folder and run

make -f Makefile.mingw prefix=/mingw
make -f Makefile.mingw prefix=/mingw install

To compile SDL_gfx-2.0.17, you'll have to change on source file: In SDL_gfxPrimitives.c, replace

#ifdef WIN32
__inline long int
lrint (double ftl)
{
int intgr;
_asm
{
fld flt
fistp intgr
};
return intgr;
}
#endif

with

#define lrint(x) (floor(x+(x>0) ? 0.5 : -0.5))

Compilling of widelands

Download of Widelands-sourcecode

Check out the widelands source code (see Download for infos on the SVNROOT and all). Rename build_id.h.default in widelands-directory/src to build_id.h - else the compiler will output an error.

Compiling the source

Start msys and go to widelands-directory/build/win32/mingw than run

make all

to generate the locales go to widelands-directory/build/win32 and run

./buildcat.sh


Further work

If you have compiled widelands, you must copy all needed dll-files in widelands-folder. Without these files widelands won't work. Normally the dll-files of these packages can be found in

<yourmingwfolder>/bin
<yourmingwfolder>/lib

You need the following dlls-files (as at July 26th, 2008):

jpeg.dll
libfreetype-6.dll
libiconv-2.dll
libintl-8.dll
libogg-0.dll
libpng12-0.dll
libpng-3.dll
libvorbis-0.dll
libvorbisfile-3.dll
SDL.dll
SDL_gfx.dll
SDL_image.dll
SDL_mixer.dll
SDL_net.dll
SDL_ttf.dll
zlib1.dll

Problems?

If there are any problems and you can't find a solution, please write on the forums or meet us on irc.
Furthermore it would be good, if you could add your hints or solutions on this page, so that people, standing before the same problems can easier find a solution.

Retrieved from "http://xoops.widelands.org/modules/mediawiki/index.php/Building_Widelands_under_Windows"

This page has been accessed 2,760 times. This page was last modified 15:30, 12 November 2008. Content is available under GNU General Public License 2.





Search


Login
Username:

Password:


Lost Password?

Register now!
Polls
Which requires the fewest improvements
Animations in game (buildings, workers, nature, animals)
Graphics in main menu
Campaigns (as well as number of campaigns)
Network support
Sounds
Music
Structure of the economies of the tribes
Maps
The transportation system
In game user interface
The editor
Hosted by