Use the following instructions to cross-compile the selacoin wallet for Windows using Ubuntu Server 18.04.
1) Update your Ubuntu machine.
sudo apt-get update
sudo apt-get upgrade
2) Install the required dependencies for MXE.
sudo apt-get install p7zip-full autoconf automake autopoint bash bison
sudo apt-get install bzip2 cmake flex gettext git g++ gperf libgtk2.0-dev ntltool libffi-dev libtool libtool-bin
sudo apt-get install libltdl-dev libssl-dev libxml-parser-perl make openssl patch perl pkg-config python ruby scons sed unzip wget xz-utils lzip python-pip g++-multilib libc6-dev-i386
3) Clone the MXE repository
cd /mnt
sudo git clone https://github.com/mxe/mxe.git
4) Compile Boost
cd /mnt/mxe
sudo make MXE_TARGETS="i686-w64-mingw32.static" boost
5) Compile QT5
cd /mnt/mxe
sudo make MXE_TARGETS="i686-w64-mingw32.static" qttools
6) Download and unpack Berkeley DB.
cd /mnt
sudo wget https://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
sudo tar zxvf db-4.8.30.tar.gz
7) Create bash script to install Berkeley DB.
cd /mnt/db-4.8.30
sudo touch compile-db.sh
sudo chmod ugo+x compile-db.sh
8) Edit the newly created bash file compile-db.sh.
sudo nano compile-db.sh
9) Paste the following in the file compile-db.sh
#!/bin/bash
MXE_PATH=/mnt/mxe
sed -i "s/WinIoCtl.h/winioctl.h/g" src/dbinc/win_db.h
mkdir build_mxe
cd build_mxe
CC=$MXE_PATH/usr/bin/i686-w64-mingw32.static-gcc \
CXX=$MXE_PATH/usr/bin/i686-w64-mingw32.static-g++ \
../dist/configure \
--disable-replication \
--enable-mingw \
--enable-cxx \
--host x86 \
--prefix=$MXE_PATH/usr/i686-w64-mingw32.static
make
make install
10) Compile Berkeley DB.
sudo ./compile-db.sh
11) Download and unpack miniupnp.
cd /mnt
sudo wget http://miniupnp.free.fr/files/miniupnpc-1.9.tar.gz
sudo tar zxvf miniupnpc-1.9.tar.gz
12) Create bash script to install miniupnp.
cd /mnt/miniupnpc-1.9
sudo touch compile-upnp.sh
sudo chmod ugo+x compile-upnp.sh
13) Edit the file compile-upnp.sh.
sudo nano compile-upnp.sh
14) Paste the following in the file compile-upnp.sh
#!/bin/bash
MXE_PATH=/mnt/mxe
CC=$MXE_PATH/usr/bin/i686-w64-mingw32.static-gcc \
AR=$MXE_PATH/usr/bin/i686-w64-mingw32.static-ar \
CFLAGS="-DSTATICLIB -I$MXE_PATH/usr/i686-w64-mingw32.static/include" \
LDFLAGS="-L$MXE_PATH/usr/i686-w64-mingw32.static/lib" \
make libminiupnpc.a
mkdir $MXE_PATH/usr/i686-w64-mingw32.static/include/miniupnpc
cp *.h $MXE_PATH/usr/i686-w64-mingw32.static/include/miniupnpc
cp libminiupnpc.a $MXE_PATH/usr/i686-w64-mingw32.static/lib
15) Compile miniupnp.
sudo ./compile-upnp.sh
16) Install OpenSSL.
cd /mnt/mxe
sudo make openssl1.0 MXE_PLUGIN_DIRS=plugins/selas/openssl1.0/
17) Create a directory for the selacoin source code.
cd ~/
mkdir source_code
cd source_code
wget "https://sela-coin.com/download/tools/selacoin-source.tar.gz" -O selacoin-source.tar.gz
17) Extract the tar file.
tar -xzvf selacoin-source.tar.gz
18) Create bash script to compile your windows wallet.
touch compile-blockchain.sh
chmod ugo+x compile-blockchain.sh
19) Edit the file compile-blockchain.sh.
sudo nano compile-blockchain.sh
20) Paste the following in the file compile-blockchain.sh.
#!/bin/bash
export PATH=/mnt/mxe/usr/bin:$PATH
MXE_INCLUDE_PATH=/mnt/mxe/usr/i686-w64-mingw32.static/include
MXE_LIB_PATH=/mnt/mxe/usr/i686-w64-mingw32.static/lib
i686-w64-mingw32.static-qmake-qt5 \
RELEASE=1 \
BOOST_LIB_SUFFIX=-mt \
BOOST_THREAD_LIB_SUFFIX=_win32-mt \
BOOST_INCLUDE_PATH=$MXE_INCLUDE_PATH/boost \
BOOST_LIB_PATH=$MXE_LIB_PATH \
OPENSSL_INCLUDE_PATH=$MXE_INCLUDE_PATH/openssl \
OPENSSL_LIB_PATH=$MXE_LIB_PATH \
BDB_INCLUDE_PATH=$MXE_INCLUDE_PATH \
BDB_LIB_PATH=$MXE_LIB_PATH \
MINIUPNPC_INCLUDE_PATH=$MXE_INCLUDE_PATH \
MINIUPNPC_LIB_PATH=$MXE_LIB_PATH \
QMAKE_LRELEASE=/mnt/mxe/usr/i686-w64-mingw32.static/qt5/bin/lrelease SelaCoin-qt.pro
make -f Makefile.Release
21) Now Compile your SelaCoin Windows wallet using the following command :
./compile-blockchain.sh
**** The compiling will take about 60 minutes depending on your system hardware.*******
***** Your compiled wallet named selacoin-qt.exe can be found in the folder “release” when compiling is finished.******