1
General / Re: Compiling SFML with mingw under Ubuntu to be able to cross-compile for windows.
« on: May 28, 2017, 03:07:19 pm »
Hi!
I don't know how to cross-compile in ubuntu, but here is what I did to cross-compile in Fedora26. Cross compiling libs is a very usefull thing, as the minGW version installed with linux do not match the one for provided libs. worse, when mixing various libs, finding compatible pre-compiled version is always a headache.
1) INSTALL DEPENDANCIES
As root run:
2) Download and compile
I don't know how to cross-compile in ubuntu, but here is what I did to cross-compile in Fedora26. Cross compiling libs is a very usefull thing, as the minGW version installed with linux do not match the one for provided libs. worse, when mixing various libs, finding compatible pre-compiled version is always a headache.
1) INSTALL DEPENDANCIES
As root run:
BIT=32
dnf -y install mingw$BIT-gcc
dnf -y install mingw$BIT-winpthreads-static mingw$BIT-winpthreads
dnf -y install mingw$BIT-libjpeg-turbo-static mingw$BIT-libjpeg-turbo
dnf -y install mingw$BIT-openal-soft
dnf -y install mingw$BIT-libvorbis
dnf -y install mingw$BIT-libogg
dnf -y install mingw$BIT-flac
updatedb
dnf -y install mingw$BIT-gcc
dnf -y install mingw$BIT-winpthreads-static mingw$BIT-winpthreads
dnf -y install mingw$BIT-libjpeg-turbo-static mingw$BIT-libjpeg-turbo
dnf -y install mingw$BIT-openal-soft
dnf -y install mingw$BIT-libvorbis
dnf -y install mingw$BIT-libogg
dnf -y install mingw$BIT-flac
updatedb
2) Download and compile
VERSION=2.4.2
CMAKE=mingw32-cmake
MAKE=mingw32-make
wget https://www.sfml-dev.org/files/SFML-$VERSION-sources.zip
unzip SFML-$VERSION-sources.zip
mkdir SFML-$VERSION-build
cd SFML-$VERSION
$CMAKE
$MAKE clean
$MAKE
$MAKE install DESTDIR=../SFML-$VERSION-build
CMAKE=mingw32-cmake
MAKE=mingw32-make
wget https://www.sfml-dev.org/files/SFML-$VERSION-sources.zip
unzip SFML-$VERSION-sources.zip
mkdir SFML-$VERSION-build
cd SFML-$VERSION
$CMAKE
$MAKE clean
$MAKE
$MAKE install DESTDIR=../SFML-$VERSION-build