Windows Build Guide
PART I - Build environment
!!WARNING!! Remove all Qt and MSYS/MinGW installations from your host (if you have any, of course) before proceeding !!WARNING!!
1. Download
MSYS Shell and run it, when MinGW Installation Manager shows up, go to "All packages -> MSYS" and select following:
msys-base-bin
msys-autoconf-bin
msys-automake-bin
msys-libtool-bin
Don't uncheck packages that will be marked automatically as you check ones mentioned above. Also, make sure that none packages from MinGW section selected. When completed, click on "Installation -> Apply changes"
Done!
2. Download
MinGW32 and extract
mingw32 folder to the root of your drive (let's count it's drive C:\). Now we need to add it to PATH variable.
Open command prompt (cmd.exe) with administrative privileges and execute following:
setx path "%path%;C:\mingw32\bin"
Assuming you have Win version 7+, Win XP users should check how to add for their system
Close your cmd and reopen it, then execute:
It should state:
GNU Make 4.1
and any other stuff
If nothing shows up, check your PATH variable.
Keep your cmd window open.Done with this part.
PART II - Dependencies
Here we have 2 options, I've uploaded precompiled libs and Qt to Mega.nz, or you can build it from scratch to prevent any errors, choose what you want.
PRECOMPILED:1.
Precompiled Libs ,
Precompiled Qt5Unpack deps.zip contents to C:\deps folder keeping hierarchy , unpack Qt5.zip to C:\Qt keeping hierarchy.
Done with this section.
BUILD FROM SCRATCH:!!NOTE!! You can speedup process by running make and mingw32-make with -jx flag, where "x" represents the number of your physical processor cores, so it would be like, for example, "make -j4" !!NOTE!!
1. Create folder named "deps" on your drive.
2. Download
OpenSSL and unpack it to your newly created "deps" folder.
Open MSYS shell (C:\MinGW\msys\1.0\msys.bat) and execute following, line-by-line:
cd /c/deps/openssl-1.0.1l
./Configure no-zlib no-shared no-dso no-krb5 no-camellia no-capieng no-cast no-cms no-dtls1 no-gost no-gmp no-heartbeats no-idea no-jpake no-md2 no-mdc2 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool no-rc2 no-rc4 no-ssl2 no-ssl3 mingw
make
Don't close your MSYS shell.3. Download
Berkley DB 4.8 and unpack it to "deps" folder.
In MSYS shell, line-by-line:
cd /c/deps/db-4.8.30.NC/build_unix
../dist/configure --enable-mingw --enable-cxx --disable-shared --disable-replication
make
4. Download
Boost 1.57 and unpack it to "deps" folder.
In CMD, line-by-line:
cd C:\deps\boost_1_57_0\
bootstrap.bat mingw
b2 --build-type=minimal --with-chrono --with-filesystem --with-program_options --with-system --with-thread --layout=versioned -sNO_BZIP2=1 -sNO_ZLIB=1 toolset=gcc variant=release link=static threading=multi target-os=windows threadapi=win32 runtime-link=static stage
5. Download
MiniuPnP 1.9 and unpack it to "deps" folder.
In CMD, line-by-line:
cd C:\deps\miniupnpc-1.9
mingw32-make -f Makefile.mingw init upnpc-static
Note that miniupnp is erroring during qt build, so it will be disabled by default, keeping it just for future releases and fixes.
6. Download
LibProtobuf and unpack it to "deps" folder.
In MSYS shell, line-by-line:
cd /c/deps/protobuf-2.6.1
configure --disable-shared
make
7. Download
LibPNG and unpack it to "deps" folder.
In MSYS shell, line-by-line:
cd /c/deps/libpng-1.6.16
configure --disable-shared
make
cp .libs/libpng16.a .libs/libpng.a
8. Download
QRencode and unpack it to "deps" folder.
In MSYS shell, line-by-line:
cd /c/deps/qrencode-3.4.4
LIBS="../libpng-1.6.16/.libs/libpng.a ../../mingw32/i686-w64-mingw32/lib/libz.a" \
png_CFLAGS="-I../libpng-1.6.16" \
png_LIBS="-L../libpng-1.6.16/.libs" \
configure --enable-static --disable-shared --without-tools
make
9. Download
QT5Base and
QT5Tools, Unpack
qtbase-opensource-src-5.3.2 folder (in archive qtbase-opensource-src-5.3.2.7z) contents to C:\Qt\5.3.2 and
qttools-opensource-src-5.3.2 folder (in archive qttools-opensource-src-5.3.2.7z) contents to C:\Qt\qttools-opensource-src-5.3.2.
In CMD, line-by-line:
set INCLUDE=C:\deps\libpng-1.6.16;C:\deps\openssl-1.0.1l\include
set LIB=C:\deps\libpng-1.6.16\.libs;C:\deps\openssl-1.0.1l
cd C:\Qt\5.3.2
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -qt-pcre -no-icu -no-gif -system-libpng -no-libjpeg -no-freetype -no-angle -no-vcproj -openssl -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug
mingw32-make
set PATH=%PATH%;C:\Qt\5.3.2\bin
cd C:\Qt\qttools-opensource-src-5.3.2
qmake qttools.pro
mingw32-make
Last mingw32-make will throw out an error, it's OK, do following:
In CMD, line-by-line:
cd C:\Qt\qttools-opensource-src-5.3.2\src\linguist\lrelease
qmake lrelease.pro
mingw32-make
After execution,
In CMD, line-by-line:
cd C:\Qt\qttools-opensource-src-5.3.2\src\linguist\lupdate
qmake lupdate.pro
mingw32-make
10. Download
GMP and unpack it to "deps" folder.
In MSYS shell, line-by-line:
cd /c/deps/gmp-6.0.0
MPN_PATH=" i686 generic" CFLAGS="-O3 -march=native -mtune=generic" CXXFLAGS="-O3 -march=native -mtune=generic" ./configure --disable-shared --enable-cxx --host=i686-w64-mingw32
make
Done with this section.
Done with this part.
PART III - Compilation
1. Download Cryptonite source zip from any fork (
pallas,
krnlx or mine, they're nearly exactly the same) and unpack it to C:\
2.
In MSYS shell, code block-by-block:
cd /c/Cryptonite-master
./autogen.sh
CPPFLAGS="-I/c/deps/db-4.8.30.NC/build_unix \
-I/c/deps/openssl-1.0.1l/include \
-I/c/deps \
-I/c/deps/protobuf-2.6.1/src \
-I/c/deps/libpng-1.6.16 \
-I/c/deps/qrencode-3.4.4 \
-I/c/deps/gmp-6.0.0" \
LDFLAGS="-L/c/deps/db-4.8.30.NC/build_unix \
-L/c/deps/openssl-1.0.1l \
-L/c/deps/miniupnpc-1.9 \
-L/c/deps/protobuf-2.6.1/src/.libs \
-L/c/deps/libpng-1.6.16/.libs \
-L/c/deps/qrencode-3.4.4/.libs \
-L/c/deps/gmp-6.0.0/.libs" \
BOOST_ROOT=/c/deps/boost_1_57_0 \
./configure \
--with-gui \
--disable-upnp-default \
--disable-tests \
--with-qt-incdir=/c/Qt/5.3.2/include \
--with-qt-libdir=/c/Qt/5.3.2/lib \
--with-qt-plugindir=/c/Qt/5.3.2/plugins \
--with-qt-bindir=/c/Qt/5.3.2/bin \
--with-protoc-bindir=/c/deps/protobuf-2.6.1/src
make
strip src/cryptonite-cli.exe
strip src/cryptonited.exe
strip src/qt/cryptonite-qt.exe
!!! Congratulations, you've just built you own Qt-wallet !!!