Latest Posts

Changes in Building Widelands

Old Title


Editor Comment

Removed scons. we no longer need it.

Revision Differences of Revision 63

## Building widelands ¶

This page is about building widelands for various OSes. If you managed to build widelands under your OS and you can't find informations about it here, please add them for the other who will come after you and try it. ¶

[TOC] ¶

### Libraries ¶

Widelands depends currently on the following libraries, make sure they all are installed and in the search path of your compiler. The suggested compiler to build widelands is gcc 4, but it might work with other compilers too. ¶

* [libSDL]( >=1.2.11 ¶
* [libSDL_gfx]( ¶
* [libSDL_image]( ¶
* [libSDL_net]( ¶
* [libSDL_mixer]( >= 1.2.6 ¶
* [libSDL_ttf]( >= 2.0.0 ¶
* [gettext]( ¶
* libiconv (on same mirrors as gettext) ¶
* [zlib]( ¶
* [libpng]( ¶
* [Boost]( >= 1.35 ¶
* [Python]( >= 1.5.2 ¶
* [
Scons]( >= 1.0.1 ¶
* [
libexpat]( ¶
* [ggz-base-libs]( >= 0.99.5 ¶
* [lua]( >= 5.1 ¶
* [doxygen]( ¶

### Building with CMake ¶

CMake is the current preprocessing system Widelands is using. More information can be found at the WidelandsGoingCMake page. ¶

#### The fastest way to build Widelands (terminal use) ¶

First of all it must be ensured, that all needed packages are installed (some help for common Linux systems can be found at the end of this chapter). As soon as you are ready with this step, ¶

* [Download](../DownloadPage) the latest build or obtain the branch: ¶
* $ bzr get lp:widelands ¶
* Change directory: ¶
* $ cd widelands ¶
* Compile Widelands (a menu will lead you through the process): ¶
* $ ./ ¶
* To run Widelands after compilation or to run it again later on (in last case make sure you are in Widelands directory ("cd widelands")): ¶
* $ ./widelands ¶

If you told the script to create an updater (only possible, if you use bzr versions) you are able to update Widelands via running ./ (again make sure you are in the Widelands directory) ¶

##### Ubuntu (Installation of needed Packages) ¶

run: **sudo apt-get install build-essential python libsdl1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-net1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev gettext libiconv-hook-dev zlib1g-dev libpng12-dev libpngwriter0-dev cmake libstdc++6-4.3-dev libgcc1 exuberant-ctags optipng libboost-dev libexpat1 libexpat1-dev libggzmod-dev bzr lua5.1 liblua5.1-0 liblua5.1-dev doxygen** ¶

*Note: To match version requirements you may have to force the version of libboost-dev to 1.35 manually; Ubuntu Intrepid/Jaunty seems to default to 1.34 for libboost-dev. To force the version, install libboost1.35-dev instead of the generic libboost-dev. If you use Ubuntu Karmic, then there should be no problems. For Lucid, install libboost-all-dev instead of libboost-dev, for Lucid's generic version is not 1.35, too.* ¶

##### Mandriva / Mageia (Installation of needed Packages) ¶

As root run (su): **urpmi gcc gcc-c++ binutils make boost-devel SDL_image-devel SDL_net-devel SDL_ttf-devel SDL_mixer-devel png-devel optipng pngrewrite ctags gettext-devel cmake SDL_gfx-devel libggz-client-libs-devel libggz-devel ggz-client-libs libjpeg-devel libtiff-devel liblua-devel doxygen bzr** ¶

### Building under Windows ¶

To access BZR, I suggest [Tortoise BZR]( ¶

#### Building under !MinGW ¶

Please visit BuildingWidelandsUnderWindows ¶

#### Building under MSVC ¶

Visual Studio 2008 is supported in trunk r5010 through CMake. Getting all the dependencies may be burdensome on windows, so most of the dependencies are provided in a bundle, which is available in lp:~jarih/+junk/widelands-3rdparty. Only need to add boost libraries. And if you want language support, gettext library from gnuwin32 project. Just compiling and running with english does not need gettext to be installed. ¶

Starting from r5480 MSVC build is using static linkage to 3rdparty libraries and set to use static C runtime. Libraries are built with VS2008 Pro Sp1, but works well with VS2008 Express. Source code for all third party libraries with VS2008 solution files and batch build support is available in lp:~jarih/+junk/wl-3rdparty-src. ¶

* Install required packages: ¶
* [Visual C++ 2008 Express]( (VS2005 likely does not work) ¶
* [CMake]( 2.6.4 or later ¶
* [Python]( ¶
* [Boost]( libraries, build with cmake if binaries are not around ¶
* [Bazaar]( ¶
* [Gettext]( for localization support ¶
* Get source and 3rd party bundle ¶
* bzr get lp:widelands ¶
* bzr get lp:~jarih/+junk/widelands-3rdparty 3rdparty ¶
* Run cmake-gui, select out of source build ¶
* Configuring may complains about include dir and some packages not found ¶
* set WL_3RDPARTY_DIR to point to 3rd party bundle directory ¶
* set boost_INCLUDE_DIR to your boost include directory (this is in advanced view) ¶
* Include gettext binary dir to visual studio paths or system path( needed for localization) ¶
* Open from Visual Studio main menu Tools/Options/ ¶
* Select Projects and Solutions/VC++ Directories on left tree view ¶
* Select 'Executable files' from combobox in top right corner ¶
* Add 'C:\\Program Files\\!GnuWin32\\bin\\' or whatever is your !GnuWin32 installation dir to bottom of the list ¶
* Alternatively you can just add gnuwin32 bin dir to your system path ¶
* Build with vs2008 ¶
* Running: ¶
* Set working dir to root source dir, or add commandline option --datadir=<root source dir> ¶

*Note on Install packages:* ¶

* By default Cmake generates visual studio projet files with User Account Control set to asInvoker, which disables registry and Program Files folder virtualization. However widelands is not yet fully Vista/win7 compatible in it's file accesses so UAC needs to be disabled. ¶
* Manually change flag in widelands project properties/Linker/Manifest File/'Enable User Account Control (UAC)' to 'No'. ¶

### Building under Mac OS X ¶

#### General ¶

First you need the developer tools from the apple site and !MacPorts for unix-like tools: ¶

* Download and install tools: ¶
* [Xcode]( ¶
* [MacPort]( ¶

* \# sudo port install bzr ¶
* cd ~/Public/ ¶
* bzr get lp:widelands ¶

Alternately: ¶
Now you'll need the following command (in to install everything needed: ¶

* Install libs: ¶
* \# sudo port install gettext libpng zlib jpeg libvorbis freetype libsdl_image \ ¶
libsdl_mixer libsdl libsdl_net libsdl_sound libsdl_ttf boost lua bzr ¶

*Note: The installation of the above is very timeconsuming!* ¶

* Download SDL_gfx and build ¶
* []( ¶
* Unpack and build with Xcode ¶

#### Building under Xcode 3.2 ¶
Widelands is build using Xcode 3.x under OSX, you therefore need OSX 10.5 or higher. ¶

* Build Widelands with !MacPort libs: ¶
* Add /opt/local/include /opt/local/include/SDL to the header search path ¶
* Add /opt/local/lib to the library path ¶
* Add SDL_gfx framework path to the project ¶
* Build Widelands with precompiled libs: ¶
* bzr branch lp:~wsk/widelands/OSX-libs ¶
* unzip ~/Public/ ¶
* Add ~/Public/Archive/wl_header ~/Public/Archive/SDL to the header search path ¶
* Add ~/Public/Archive/wl_libs to the library path ¶

Help is available on the mailing list. ¶

#### Known bugs ¶

libsdl_image (at least 1.2.10) is broken under Mac OS X. ¶
To build it correctly, you need to add --disable-imageio to the configure flags, otherwise the terrain will be displayed wrongly inside of widelands. ¶
*Note: If using !MacPorts the fix above is obsolet.* ¶