Latest Posts

Changes in BuildingWidelandsUnderWindowsNew

Revision Differences of Revision 7

# How to build Widelands with !MinGW64 on Windows ¶

This is currently a work in progress! ¶

[TOC] ¶

# Download files ¶
## Nuwen's !MinGW64 distro ¶

Download the main distro from [http://nuwen.net/mingw.html](http://nuwen.net/mingw.html) and the MSYS package: ¶

* [mingw-12.2.exe](http://nuwen.net/files/mingw/mingw-12.2.exe) ¶
* [msys-10.4.7z](http://nuwen.net/files/mingw/msys-10.4.7z) ¶

## SDL2 source packages ¶
* [SDL2](https://www.libsdl.org/release/SDL2-2.0.3.zip) ¶
* [SDL2_net](https://www.libsdl.org/projects/SDL_net/) ¶
* [SDL2_mixer](http://www.libsdl.org/projects/SDL_mixer/) ¶
* [SDL2_image](https://www.libsdl.org/projects/SDL_image/) ¶


## Additional libraries ¶
* [
gzip](ftp://ftp.gnu.org/gnu/gzip/gzip-1.6.tar.gz) ¶
* [
libvorbis](http://xiph.org/vorbis/) ¶
* [libogg](http://xiph.org/ogg/) ¶
* [libiconv](ftp://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz) ¶
* [gettext](ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.4.tar.gz) ¶
* [freetype](http://download.savannah.gnu.org/releases/freetype/freetype-doc-2.5.5.tar.gz) ¶

# Building all libraries ¶

* Use the self-extracting installer of Nuwen's and extract the distro to *C:\\MinGW* ¶
* Extract MSYS manually to *c:\\msys-10.4* ¶
* Open the distro window with *C:\\MinGW\\open_distro_window.bat* ¶
* Change the directory with "cd c:\\msys-10.4" and call *extract.bat* ¶
* Start MSYS with *msys.bat* ¶

You are now in a linux like shell, so the command syntax is a bit different than normal windows commands ¶

* Extract all source packages to *c:\\msys-10.4\\home\\<username>\\* ¶
* Build each package with "./configure --prefix=/c/mingw && make install" ¶
* To get no errors when compiling gettext, you'll have to compile gzip on your own. But gzip1.6 does only compile on mingw64 with two patches applied: ¶

diff --git a/tailor.h b/tailor.h ¶
index 0bf88ff..e563b66 100644 ¶
--- a/tailor.h ¶
+++ b/tailor.h ¶
@@ -219,6 +219,10 @@ ¶
# define OS_CODE 0x0a ¶
#endif ¶

+#ifndef SIGPIPE ¶
+# define SIGPIPE 0 ¶
+#endif ¶
+ ¶

/* Common defaults */ ¶

diff --git a/ChangeLog b/ChangeLog ¶
index 06777de..3c3794f 100644 ¶
--- a/ChangeLog ¶
+++ b/ChangeLog ¶
@@ -1,3 +1,10 @@ ¶
+2013-06-15 Paul Eggert <eggert@cs.ucla.edu> ¶
+ ¶
+ msvc-inval: port to mingw-w64 ¶
+ * lib/msvc-inval.c (gl_msvc_invalid_parameter_handler): ¶
+ Use __cdecl, not cdecl, for mingw-w64. Reported by LRN in ¶
+ <http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00039.html>. ¶
+ ¶
2013-06-11 Paul Eggert <eggert@cs.ucla.edu> ¶

getcwd-lgpl: port to Tru64 ¶
diff --git a/lib/msvc-inval.c b/lib/msvc-inval.c ¶
index ef2b860..1873e23 100644 ¶
--- a/lib/msvc-inval.c ¶
+++ b/lib/msvc-inval.c ¶
@@ -28,7 +28,7 @@ ¶

# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING ¶

-static void cdecl ¶
+static void __cdecl ¶
gl_msvc_invalid_parameter_handler (const wchar_t *expression, ¶
const wchar_t *function, ¶
const wchar_t *file, ¶
@@ -45,7 +45,7 @@ gl_msvc_invalid_parameter_handler (const wchar_t *expression, ¶

# if defined _MSC_VER ¶

-static void cdecl ¶
+static void __cdecl ¶
gl_msvc_invalid_parameter_handler (const wchar_t *expression, ¶
const wchar_t *function, ¶
const wchar_t *file, ¶
@@ -94,7 +94,7 @@ gl_msvc_inval_current (void) ¶
} ¶
} ¶

-static void cdecl ¶
+static void __cdecl ¶
gl_msvc_invalid_parameter_handler (const wchar_t *expression, ¶
const wchar_t *function, ¶
const wchar_t *file, ¶
-- ¶
1.7.2.5 ¶
* Libiconv and freetype have circular dependencies, so you should compile libiconv, then freetype and then libiconv again (make a distclean and a ./configure) ¶

# Download CMake and Ninja ¶

* Download [Ninja](https://github.com/martine/ninja/releases/download/v1.5.1/ninja-win.zip). Extract simply to *C:\\mingw\\bin*. ¶
* Download [CMAKE](http://www.cmake.org/files/v3.1/cmake-3.1.0-rc2-win32-x86.zip) ¶

# Getting Widelands source code ¶

# Building Widelands ¶

We will build ninja in the normal distro window and not in the MSYS shell: ¶

* Switch to the directory you'll want to build widelands in, e.g. *C:\\wl_build* ¶
* run CMAKE "cmake -G Ninja -DCMAKE_PREFIX_PATH=C:\\Mingw c:\\bzr\\widelands\\trunk" ¶
* Just call "ninja" to build now