Difference between revisions of "Compiling for Windows on Linux"

From The Powder Toy
Jump to: navigation, search
(talk)
m (1 revision)
(No difference)

Revision as of 19:35, 28 September 2011

This is for Linux users to cross-compile to Windows 32-bit.

BEFORE WE START, PLEASE MAKE SURE YOU CAN COMPILE FOR LINUX FIRST!

Packages

Search for the following in your package manager: mingw32 mingw32-binutils mingw32-runtime

Ubuntu Users: Copy and paste this into your address bar (FireFox):

apt:mingw32,mingw32-binutils,mingw32-runtime

If it doesn't work, use the following in a terminal:

sudo apt-get install mingw32 mingw32-binutils mingw32-runtime

Debian Users In a terminal:\\ su -c "apt-get install mingw32 mingw32-binutils mingw32-runtime"

Arch Users In your Terminal: su -c 'pacman -S mingw32-{gcc,binutils,runtime}

Things you need to Download

Yes, you need to download some bits.

*  SDL-devel-1.2.14-mingw32.tar.gz from http:''www.libsdl.org/
*  bzip2-1.0.5-2-mingw32-dev.tar.lzma from  MinGW on SourceForge.
*  mingw32-libgnurx-2.5.1-dev.tar from  MinGW on SourceForge

Extraction

THE EXTRACTION PROCESS CAN ONLY BE DONE AS ROOT USER. USE AN ALTERNATE WORKSPACE AND CLOSE ALL WINDOWS WHEN FINISHED.

GNOME: sudo nautilus -OR- su -c "nautilus"\\ XFCE use Thunar instead of Nautilus\\ KDE use Konqueror

The target folder for all extractions is /usr/i586-mingw32msvc (Arch use /usr/i486-mingw32)\\ Everything I'm telling you to extract is a folder and any overwrites or merges should be permitted.

SDL-devel-1.2.14-mingw32.tar.gz

Extract the bin, include and libs folders

bzip2-1.0.5-2-mingw32-dev.tar.gz

Extract the entire archive.

mingw32-libgnurx-2.5.1-dev.tar

Extract the entire archive.

DLLs

These DLLs will need to be distributed with your builds so they work. Or if your lazy you can just post the URLs and tell everyone else to download them.

* [[1]] - SDL.dll
* [[2]] - libbz2-2.dll
* [[3]] - libgnurx-0.dll

Compile

Some Makefile changes may be needed.

Arch users need to set the following in the Makefile:

WIN_COMPILER := i486-mingw32-gcc WIN_RES := i486-mingw32-windres

Change all instances of -llibregex to -llibgnurx

Save, Exit, cd to your powder toy directory and run:\\ $make powder-sse.exe powder-sse2.exe powder-sse3.exe