Bitcoin Forum
April 19, 2014, 09:00:06 PM *
News: Due to the OpenSSL heartbleed bug, changing your forum password is recommended.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  Print  
Author Topic: Building headless Bitcoin and Bitcoin-qt on Windows  (Read 67573 times)
nitrogenetics
Member
**
Offline Offline

Activity: 80



View Profile

Ignore
March 05, 2013, 10:26:41 PM
 #1

Hi all, I recently went through the process of building bitcoind on windows.
I found the official build-msw.txt to be a bit lacking, so I thought that documenting the steps here on the forums could save some time to people wanting to compile their own windows binary. Wink

Please note this is mostly for testing purposes. Always use official executables on production environments.
The following instructions are intended for use with the latest 0.9.1. See additional notes if compiling an older 0.8.6 version.

1. Prepare your build system.
I strongly suggest setting up a clean windows virtual machine via Virtualbox or similar.

1.1 Install msys shell:
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download
From MinGW installation manager -> All packages -> MSYS
mark the following for installation:

msys-base-bin
msys-autoconf-bin
msys-automake-bin
msys-libtool-bin


then click on Installation -> Apply changes

Make sure no mingw packages are checked for installation or present from a previous install. Only the above msys packages should be installed. Also make sure that msys-gcc and msys-w32api packages are not installed.

1.2 Install Perl:
http://downloads.activestate.com/ActivePerl/releases/5.18.1.1800/ActivePerl-5.18.1.1800-MSWin32-x64-297570.msi
You can exclude Perl Script, PPM, documentation and examples if you don't need them for other purposes.

1.3 Install Python:
http://www.python.org/ftp/python/3.3.3/python-3.3.3.amd64.msi

1.4 Install a toolchain from MinGW-builds project:
Download and unpack i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z to C:\
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z/download

1.5. Ensure that mingw-builds, Perl and Python bin folders are set in your PATH environment variable. On Windows 7 your path should look something like:
Code:
C:\mingw32\bin;C:\Python33;C:\Perl64\site\bin;C:\Perl64\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

1.6 Additional checks:
C:\MinGW\bin should contain nothing but mingw-get.exe.
Your gcc -v output should be:
Code:
$ gcc -v
Using built-in specs.
COLLECT_GCC=c:\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.8.2/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-4.8.2/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-cloog=/c/mingw482/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf-rev3, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include -I/c/mingw482/prerequisites/i686-zlib-static/include -I/c/mingw482/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include -I/c/mingw482/prerequisites/i686-zlib-static/include -I/c/mingw482/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/lib -L/c/mingw482/prerequisites/i686-zlib-static/lib -L/c/mingw482/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
Thread model: posix
gcc version 4.8.2 (i686-posix-dwarf-rev3, Built by MinGW-W64 project)


2. Download, unpack and build required dependencies.
I'll save them in c:\deps folder.

2.1 OpenSSL: http://www.openssl.org/source/openssl-1.0.1g.tar.gz
From a MinGw shell (C:\MinGW\msys\1.0\msys.bat), unpack the source archive with tar (this will avoid symlink issues) then configure and make:
Code:
cd /c/deps/
tar xvfz openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
Configure mingw
make

2.2 Berkeley DB: http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
We'll use version 4.8 to preserve binary wallet compatibility.
From a MinGW shell unpack the source archive, configure and make:
Code:
cd /c/deps/
tar xvfz db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --disable-replication --enable-mingw --enable-cxx
make

2.3 Boost: http://sourceforge.net/projects/boost/files/boost/1.55.0/
Download either the zip or the 7z archive, unpack boost inside your C:\deps folder, then bootstrap and compile from a Windows command prompt:
Code:
cd C:\deps\boost_1_55_0\
bootstrap.bat mingw
b2 --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread toolset=gcc stage

This will compile the required boost libraries and put them into the stage folder (C:\deps\boost_1_55_0\stage).
Note: make sure you don't use tarballs, as unix EOL markers can break batch files.

2.4 Miniupnpc: http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.tar.gz
Unpack Miniupnpc to C:\deps, rename containing folder from "miniupnpc-1.9" to "miniupnpc" then from a Windows command prompt:
Code:
cd C:\deps\miniupnpc
mingw32-make -f Makefile.mingw init upnpc-static

2.5 protoc and libprotobuf:
Download and unpack http://protobuf.googlecode.com/files/protobuf-2.5.0.zip
Then from msys shell
Code:
cd /c/deps/protobuf-2.5.0
./autogen.sh
configure
make

2.6 qrencode:
Download and unpack http://prdownloads.sourceforge.net/libpng/libpng-1.6.9.tar.gz?download inside your deps folder then configure and make:
Code:
cd /c/deps/libpng-1.6.9
configure
make

Download and unpack http://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.gz inside your deps folder then configure and make:
Code:
cd /c/deps/qrencode-3.4.3

LIBS="../libpng-1.6.9/.libs/libpng16.a ../../mingw32/i686-w64-mingw32/lib/libz.a" \
png_CFLAGS="-I../libpng-1.6.9" \
png_LIBS="-L../libpng-1.6.9/.libs" \
configure --enable-static --disable-shared

make

2.7 Qt 5 libraries:
Qt must be configured with ssl and zlib support.
Download and unpack Qt base and tools sources:
http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtbase-opensource-src-5.2.1.7z
http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qttools-opensource-src-5.2.1.7z
Then from a windows command prompt (note that the following supposes qtbase is unpacked into C:\Qt\5.2.1 and qtttools are unpacked into C:\Qt\qttools-opensource-src-5.2.1):
Code:
set INCLUDE=C:\deps\libpng-1.6.9;C:\deps\openssl-1.0.1g\include
set LIB=C:\deps\libpng-1.6.9\.libs;C:\deps\openssl-1.0.1g

cd C:\Qt\5.2.1
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.2.1\bin

cd C:\Qt\qttools-opensource-src-5.2.1
qmake qttools.pro
mingw32-make


3. Download and unpack Bitcoin 0.9.1 from git https://github.com/bitcoin/bitcoin/archive/v0.9.1.zip
Patch makefile to avoid being asked for permission during compile process (replace relevant rm with rm -f)
Code:
--- Makefile.include Sun Mar 16 12:05:28 2014
+++ Makefile.include Wed Mar 26 03:05:58 2014
@@ -40,18 +40,18 @@
 ui_%.h: %.ui
  @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D)
  @test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@
- $(SED) -i.bak -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ && rm $(abs_builddir)/$@.bak
- $(SED) -i.bak -e '/^\*\*.*by:/d' $(abs_builddir)/$@ && rm $(abs_builddir)/$@.bak
+ $(SED) -i.bak -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ && rm -f $(abs_builddir)/$@.bak
+ $(SED) -i.bak -e '/^\*\*.*by:/d' $(abs_builddir)/$@ && rm -f $(abs_builddir)/$@.bak
 
 %.moc: %.cpp
  QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $<
- $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak
- $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak
+ $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm -f $@.bak
+ $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm -f $@.bak
 
 moc_%.cpp: %.h
  QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $<
- $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak
- $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak
+ $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm -f $@.bak
+ $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm -f $@.bak
 
 %.qm: %.ts
  @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D)
--- qt/Makefile.am Sun Mar 16 12:05:28 2014
+++ qt/Makefile.am Wed Mar 26 03:06:21 2014
@@ -371,7 +371,7 @@
 $(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H)
  @cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \
   echo error: could not build $@
- $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak
- $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak
+ $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm -f $@.bak
+ $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm -f $@.bak
 
 CLEANFILES = $(BUILT_SOURCES) $(QT_QM) $(QT_FORMS_H) *.gcda *.gcno

from msys shell configure and make bitcoin:
Code:
cp /c/deps/libpng-1.6.9/.libs/libpng16.a /c/deps/libpng-1.6.9/.libs/libpng.a

cd /c/bitcoin-0.9.1

./autogen.sh

CPPFLAGS="-I/c/deps/boost_1_55_0 \
-I/c/deps/db-4.8.30.NC/build_unix \
-I/c/deps/openssl-1.0.1g/include \
-I/c/deps \
-I/c/deps/protobuf-2.5.0/src \
-I/c/deps/libpng-1.6.9 \
-I/c/deps/qrencode-3.4.3" \
LDFLAGS="-L/c/deps/boost_1_55_0/stage/lib \
-L/c/deps/db-4.8.30.NC/build_unix \
-L/c/deps/openssl-1.0.1g \
-L/c/deps/miniupnpc \
-L/c/deps/protobuf-2.5.0/src/.libs \
-L/c/deps/libpng-1.6.9/.libs \
-L/c/deps/qrencode-3.4.3/.libs" \
./configure \
--disable-upnp-default \
--disable-tests \
--with-qt-incdir=/c/Qt/5.2.1/include \
--with-qt-libdir=/c/Qt/5.2.1/lib \
--with-qt-bindir=/c/Qt/5.2.1/bin \
--with-qt-plugindir=/c/Qt/5.2.1/plugins \
--with-boost-system=mgw48-mt-s-1_55 \
--with-boost-filesystem=mgw48-mt-s-1_55 \
--with-boost-program-options=mgw48-mt-s-1_55 \
--with-boost-thread=mgw48-mt-s-1_55 \
--with-boost-chrono=mgw48-mt-s-1_55 \
--with-protoc-bindir=/c/deps/protobuf-2.5.0/src

make

strip src/bitcoin-cli.exe
strip src/bitcoind.exe
strip src/qt/bitcoin-qt.exe



64 bit binaries
64 bit binaries can be compiled by using the following toolchain:
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.8.2/threads-posix/seh/x86_64-4.8.2-release-posix-seh-rt_v3-rev3.7z/download

All dependencies must be rebuilt with the above toolchain.
Openssl should be configured with:
Code:
Configure mingw64





Additional notes for Bitcoin 0.8.6
msys-autoconf, msys-automake and msys-libtool at step 1.1 are not needed. You can skip steps 2.5 and 2.7.


Compile bitcoind: https://github.com/bitcoin/bitcoin/archive/v0.8.6.zip

With a texteditor edit BOOST_SUFFIX, INCLUDEPATHS and LIBPATHS in your C:\bitcoin-0.8.6\src\makefile.mingw according to your dependencies location:
Code:
BOOST_SUFFIX?=-mgw48-mt-s-1_55

INCLUDEPATHS= \
 -I"$(CURDIR)" \
 -I"/c/deps/boost_1_55_0" \
 -I"/c/deps/db-4.8.30.NC/build_unix" \
 -I"/c/deps/openssl-1.0.1g/include"
 
LIBPATHS= \
 -L"$(CURDIR)/leveldb" \
 -L"/c/deps/boost_1_55_0/stage/lib" \
 -L"/c/deps/db-4.8.30.NC/build_unix" \
 -L"/c/deps/openssl-1.0.1g"

and add -static option to LDFLAGS in makefile.mingw to compile a statically linked executable.
Code:
LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware -static

makefile.mingw patch:
Code:
--- makefile.mingw Thu Dec 05 14:11:26 2013
+++ makefile.mingw Sat Apr 05 12:30:43 2014
@@ -21,15 +21,19 @@
 USE_IPV6:=1
 
 DEPSDIR?=/usr/local
-BOOST_SUFFIX?=-mgw46-mt-sd-1_52
+BOOST_SUFFIX?=-mgw48-mt-s-1_55
 
 INCLUDEPATHS= \
  -I"$(CURDIR)" \
- -I"$(DEPSDIR)/include"
-
+ -I"/c/deps/boost_1_55_0" \
+ -I"/c/deps/db-4.8.30.NC/build_unix" \
+ -I"/c/deps/openssl-1.0.1g/include"
+
 LIBPATHS= \
  -L"$(CURDIR)/leveldb" \
- -L"$(DEPSDIR)/lib"
+ -L"/c/deps/boost_1_55_0/stage/lib" \
+ -L"/c/deps/db-4.8.30.NC/build_unix" \
+ -L"/c/deps/openssl-1.0.1g"
 
 LIBS= \
  -l leveldb \
@@ -47,7 +51,7 @@
 DEBUGFLAGS=-g
 CFLAGS=-mthreads -O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
 # enable: ASLR, DEP and large address aware
-LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware
+LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware -static
 
 TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
 

Upnp support is disabled by default. If you want to compile with upnp support set
Code:
USE_UPNP:=1
and add miniupnpc path to INCLUDEPATHS and LIBPATHS:
Code:
INCLUDEPATHS= \
 -I"$(CURDIR)" \
 -I"/c/deps/boost_1_55_0" \
 -I"/c/deps" \
 -I"/c/deps/db-4.8.30.NC/build_unix" \
 -I"/c/deps/openssl-1.0.1g/include"
 
LIBPATHS= \
 -L"$(CURDIR)/leveldb" \
 -L"/c/deps/boost_1_55_0/stage/lib" \
 -L"/c/deps/miniupnpc" \
 -L"/c/deps/db-4.8.30.NC/build_unix" \
 -L"/c/deps/openssl-1.0.1g"

From Msys shell compile bitcoind:
Code:
cd /c/bitcoin-0.8.6/src
make -f makefile.mingw
strip bitcoind.exe


Compile bitcoin-qt 0.8.6 with Qt 4.8:
Download and unpack http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.zip
Assuming qt sources are unpacked to C:\Qt\4.8.5, from a windows command prompt:

Code:
cd C:\Qt\4.8.5
configure -release -opensource -confirm-license -static -no-sql-sqlite -no-qt3support -no-opengl -qt-zlib -no-gif -qt-libpng -qt-libmng -no-libtiff -qt-libjpeg -no-dsp -no-vcproj -no-openssl -no-dbus -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-webkit -no-script -no-scripttools -no-declarative -no-declarative-debug -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -nomake demos -nomake examples
mingw32-make

Note that if you skipped bitcoind compilation or if you have cleaned up your source folder you will need to compile libleveldb.a and libmemenv.a libraries before proceeding.
From msys shell:
Code:
cd /C/bitcoin-0.8.6/src/leveldb
TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a


Edit C:\bitcoin-0.8.6\bitcoin-qt.pro with your favourite text editor and add

dependency library locations:
Code:
# Dependency library locations can be customized with:
#    BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH,
#    BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively

BOOST_LIB_SUFFIX=-mgw48-mt-s-1_55
BOOST_INCLUDE_PATH=C:/deps/boost_1_55_0
BOOST_LIB_PATH=C:/deps/boost_1_55_0/stage/lib
BDB_INCLUDE_PATH=C:/deps/db-4.8.30.NC/build_unix
BDB_LIB_PATH=C:/deps/db-4.8.30.NC/build_unix
OPENSSL_INCLUDE_PATH=C:/deps/openssl-1.0.1g/include
OPENSSL_LIB_PATH=C:/deps/openssl-1.0.1g
MINIUPNPC_INCLUDE_PATH=C:/deps/
MINIUPNPC_LIB_PATH=C:/deps/miniupnpc
QRENCODE_INCLUDE_PATH=C:/deps/qrencode-3.4.3
QRENCODE_LIB_PATH=C:/deps/qrencode-3.4.3/.libs

Comment out genleveldb.commands for win32
Code:
   LIBS += -lshlwapi
    #genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
}

flags for static build:
Code:
CONFIG += static

Code:
win32:QMAKE_LFLAGS *= -Wl,--large-address-aware -static

bitcoin-qt.pro patch:
Code:
--- bitcoin-qt.pro Thu Dec 05 14:11:26 2013
+++ bitcoin-qt.pro Sat Apr 05 14:51:31 2014
@@ -7,6 +7,7 @@
 DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
 CONFIG += no_include_pwd
 CONFIG += thread
+CONFIG += static
 
 # for boost 1.37, add -mt to the boost libraries
 # use: qmake BOOST_LIB_SUFFIX=-mt
@@ -17,6 +18,17 @@
 # Dependency library locations can be customized with:
 #    BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH,
 #    BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively
+BOOST_LIB_SUFFIX=-mgw48-mt-s-1_55
+BOOST_INCLUDE_PATH=C:/deps/boost_1_55_0
+BOOST_LIB_PATH=C:/deps/boost_1_55_0/stage/lib
+BDB_INCLUDE_PATH=C:/deps/db-4.8.30.NC/build_unix
+BDB_LIB_PATH=C:/deps/db-4.8.30.NC/build_unix
+OPENSSL_INCLUDE_PATH=C:/deps/openssl-1.0.1g/include
+OPENSSL_LIB_PATH=C:/deps/openssl-1.0.1g
+MINIUPNPC_INCLUDE_PATH=C:/deps/
+MINIUPNPC_LIB_PATH=C:/deps/miniupnpc
+QRENCODE_INCLUDE_PATH=C:/deps/qrencode-3.4.3
+QRENCODE_LIB_PATH=C:/deps/qrencode-3.4.3/.libs
 
 OBJECTS_DIR = build
 MOC_DIR = build
@@ -47,7 +59,7 @@
 # for extra security on Windows: enable ASLR and DEP via GCC linker flags
 win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
 # on Windows: enable GCC large address aware linker flag
-win32:QMAKE_LFLAGS *= -Wl,--large-address-aware
+win32:QMAKE_LFLAGS *= -Wl,--large-address-aware -static
 
 # use: qmake "USE_QRCODE=1"
 # libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
@@ -109,7 +121,7 @@
         QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
     }
     LIBS += -lshlwapi
-    genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
+    #genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
 }
 genleveldb.target = $$PWD/src/leveldb/libleveldb.a
 genleveldb.depends = FORCE

From a windows command prompt configure and make:
Code:
set PATH=%PATH%;C:\Qt\4.8.5\bin
cd C:\bitcoin-0.8.6\
qmake "USE_QRCODE=1" "USE_UPNP=1" "USE_IPV6=1" bitcoin-qt.pro
mingw32-make -f Makefile.Release





Additional notes for Bitcoin-qt 0.8.6 with qt5
Download and unpack Qt base and tools sources:
http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtbase-opensource-src-5.2.1.7z
http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qttools-opensource-src-5.2.1.7z

From a windows command prompt configure and make:
Code:
cd C:\Qt\5.2.1
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -qt-zlib -qt-pcre -no-icu -no-gif -qt-libpng -qt-libjpeg -no-angle -no-vcproj -no-openssl -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug
mingw32-make

then

Code:
set PATH=%PATH%;C:\Qt\5.2.1\bin
cd C:\Qt\qttools-opensource-src-5.2.1
qmake qttools.pro
mingw32-make


Edit C:\bitcoin-0.8.6\bitcoin-qt.pro with your favourite text editor and add qt widgets
Code:
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

dependency library locations:
Code:
# Dependency library locations can be customized with:
#    BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH,
#    BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively

BOOST_LIB_SUFFIX=-mgw48-mt-s-1_55
BOOST_INCLUDE_PATH=C:/deps/boost_1_55_0
BOOST_LIB_PATH=C:/deps/boost_1_55_0/stage/lib
BDB_INCLUDE_PATH=C:/deps/db-4.8.30.NC/build_unix
BDB_LIB_PATH=C:/deps/db-4.8.30.NC/build_unix
OPENSSL_INCLUDE_PATH=C:/deps/openssl-1.0.1g/include
OPENSSL_LIB_PATH=C:/deps/openssl-1.0.1g
MINIUPNPC_INCLUDE_PATH=C:/deps/
MINIUPNPC_LIB_PATH=C:/deps/miniupnpc
QRENCODE_INCLUDE_PATH=C:/deps/qrencode-3.4.3
QRENCODE_LIB_PATH=C:/deps/qrencode-3.4.3/.libs

Comment out genleveldb.commands for win32
Code:
   LIBS += -lshlwapi
    #genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
}

flags for static build:
Code:
CONFIG += static

Code:
win32:QMAKE_LFLAGS *= -Wl,--large-address-aware -static


Bitcoin 0.8.6 will need some patches in order to compile with Qt5:
Remove #define loop from util.h and replace loop with while (true) in
src/bitcoinrpc.cpp
src/main.cpp
src/net.cpp
src/script.cpp
src/util.cpp
src/wallet.cpp
src/walletdb.cpp
see: https://github.com/bitcoin/bitcoin/commit/8351d55cd3955c95c5e3fe065a456db08cc8a559

Qt5 compatibility. #if QT_VERSION < 0x050000 ... in
src/qt/addressbookpage.cpp
src/qt/bitcoin.cpp
src/qt/bitcoingui.cpp
src/qt/guiutil.cpp
src/qt/paymentserver.cpp
src/qt/qrcodedialog.cpp
src/qt/rpcconsole.cpp
src/qt/sendcoinsdialog.cpp
src/qt/transactionview.cpp
src/qt/walletview.cpp
see: https://github.com/bitcoin/bitcoin/commit/25c0cce7fb494fcb871d134e28b26504d30e34d3
http://qt-project.org/doc/qt-5.0/qtdoc/sourcebreaks.html
http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5

Qt5 compatibility patch:
Code:
--- bitcoinrpc.cpp Thu Dec 05 13:11:26 2013
+++ bitcoinrpc.cpp Tue Dec 31 02:25:11 2013
@@ -417,7 +417,7 @@
 int ReadHTTPHeaders(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet)
 {
     int nLen = 0;
-    loop
+    while (true)
     {
         string str;
         std::getline(stream, str);
--- main.cpp Thu Dec 05 13:11:26 2013
+++ main.cpp Tue Dec 31 02:25:11 2013
@@ -4551,7 +4551,7 @@
     CReserveKey reservekey(pwallet);
     unsigned int nExtraNonce = 0;
 
-    try { loop {
+    try { while (true) {
         while (vNodes.empty())
             MilliSleep(1000);
 
@@ -4591,7 +4591,7 @@
         uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
         uint256 hashbuf[2];
         uint256& hash = *alignup<16>(hashbuf);
-        loop
+        while (true)
         {
             unsigned int nHashesDone = 0;
             unsigned int nNonceFound;
--- net.cpp Thu Dec 05 13:11:26 2013
+++ net.cpp Tue Dec 31 02:25:11 2013
@@ -135,7 +135,7 @@
 bool RecvLine(SOCKET hSocket, string& strLine)
 {
     strLine = "";
-    loop
+    while (true)
     {
         char c;
         int nBytes = recv(hSocket, &c, 1, 0);
@@ -307,7 +307,7 @@
     {
         if (strLine.empty()) // HTTP response is separated from headers by blank line
         {
-            loop
+            while (true)
             {
                 if (!RecvLine(hSocket, strLine))
                 {
@@ -750,7 +750,7 @@
 void ThreadSocketHandler()
 {
     unsigned int nPrevNodeCount = 0;
-    loop
+    while (true)
     {
         //
         // Disconnect nodes
@@ -1114,7 +1114,7 @@
         string strDesc = "Bitcoin " + FormatFullVersion();
 
         try {
-            loop {
+            while (true) {
 #ifndef UPNPDISCOVER_SUCCESS
                 /* miniupnpc 1.5 */
                 r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
@@ -1378,7 +1378,7 @@
 
     // Initiate network connections
     int64 nStart = GetTime();
-    loop
+    while (true)
     {
         ProcessOneShot();
 
@@ -1429,7 +1429,7 @@
         int64 nANow = GetAdjustedTime();
 
         int nTries = 0;
-        loop
+        while (true)
         {
             // use an nUnkBias between 10 (no outgoing connections) and 90 (8 outgoing connections)
             CAddress addr = addrman.Select(10 + min(nOutbound,8)*10);
--- script.cpp Thu Dec 05 13:11:26 2013
+++ script.cpp Tue Dec 31 02:25:11 2013
@@ -1163,7 +1163,7 @@
         // Compare
         CScript::const_iterator pc1 = script1.begin();
         CScript::const_iterator pc2 = script2.begin();
-        loop
+        while (true)
         {
             if (pc1 == script1.end() && pc2 == script2.end())
             {
--- util.cpp Thu Dec 05 13:11:26 2013
+++ util.cpp Tue Dec 31 02:25:11 2013
@@ -311,7 +311,7 @@
     char* p = buffer;
     int limit = sizeof(buffer);
     int ret;
-    loop
+    while (true)
     {
         va_list arg_ptr;
         va_copy(arg_ptr, ap);
@@ -371,7 +371,7 @@
         return;
     string::size_type i1 = 0;
     string::size_type i2;
-    loop
+    while (true)
     {
         i2 = str.find(c, i1);
         if (i2 == str.npos)
@@ -500,7 +500,7 @@
 {
     // convert hex dump to vector
     vector<unsigned char> vch;
-    loop
+    while (true)
     {
         while (isspace(*psz))
             psz++;
@@ -954,7 +954,7 @@
 
 bool WildcardMatch(const char* psz, const char* mask)
 {
-    loop
+    while (true)
     {
         switch (*mask)
         {
--- util.h Thu Dec 05 13:11:26 2013
+++ util.h Tue Dec 31 02:25:11 2013
@@ -37,7 +37,6 @@
 static const int64 COIN = 100000000;
 static const int64 CENT = 1000000;
 
-#define loop                for (;;)
 #define BEGIN(a)            ((char*)&(a))
 #define END(a)              ((char*)&((&(a))[1]))
 #define UBEGIN(a)           ((unsigned char*)&(a))
--- wallet.cpp Thu Dec 05 13:11:26 2013
+++ wallet.cpp Tue Dec 31 02:25:11 2013
@@ -1173,7 +1173,7 @@
         LOCK2(cs_main, cs_wallet);
         {
             nFeeRet = nTransactionFee;
-            loop
+            while (true)
             {
                 wtxNew.vin.clear();
                 wtxNew.vout.clear();
--- walletdb.cpp Thu Dec 05 13:11:26 2013
+++ walletdb.cpp Tue Dec 31 02:25:11 2013
@@ -73,7 +73,7 @@
     if (!pcursor)
         throw runtime_error("CWalletDB::ListAccountCreditDebit() : cannot create DB cursor");
     unsigned int fFlags = DB_SET_RANGE;
-    loop
+    while (true)
     {
         // Read next record
         CDataStream ssKey(SER_DISK, CLIENT_VERSION);
@@ -415,7 +415,7 @@
             return DB_CORRUPT;
         }
 
-        loop
+        while (true)
         {
             // Read next record
             CDataStream ssKey(SER_DISK, CLIENT_VERSION);
--- qt/addressbookpage.cpp Thu Dec 05 13:11:26 2013
+++ qt/addressbookpage.cpp Tue Dec 31 02:25:11 2013
@@ -143,8 +143,13 @@
     ui->tableView->sortByColumn(0, Qt::AscendingOrder);
 
     // Set column widths
+#if QT_VERSION < 0x050000
     ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Label, QHeaderView::Stretch);
     ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents);
+#else
+    ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Label, QHeaderView::Stretch);
+    ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents);
+#endif
 
     connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
             this, SLOT(selectionChanged()));
--- qt/bitcoin.cpp Thu Dec 05 13:11:26 2013
+++ qt/bitcoin.cpp Tue Dec 31 02:25:11 2013
@@ -17,7 +17,9 @@
 #include "splashscreen.h"
 
 #include <QMessageBox>
+#if QT_VERSION < 0x050000
 #include <QTextCodec>
+#endif
 #include <QLocale>
 #include <QTimer>
 #include <QTranslator>
@@ -118,9 +120,11 @@
     // Command-line options take precedence:
     ParseParameters(argc, argv);
 
+#if QT_VERSION < 0x050000
     // Internal string conversion is all UTF-8
     QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
     QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());
+#endif
 
     Q_INIT_RESOURCE(bitcoin);
     QApplication app(argc, argv);
--- qt/bitcoingui.cpp Thu Dec 05 13:11:26 2013
+++ qt/bitcoingui.cpp Tue Dec 31 02:25:11 2013
@@ -44,7 +44,9 @@
 #include <QMovie>
 #include <QTimer>
 #include <QDragEnterEvent>
+#if QT_VERSION < 0x050000
 #include <QUrl>
+#endif
 #include <QMimeData>
 #include <QStyle>
 #include <QSettings>
--- qt/guiutil.cpp Thu Dec 05 13:11:26 2013
+++ qt/guiutil.cpp Tue Dec 31 02:25:11 2013
@@ -13,8 +13,12 @@
 #include <QDoubleValidator>
 #include <QFont>
 #include <QLineEdit>
+#if QT_VERSION >= 0x050000
+#include <QUrlQuery>
+#else
 #include <QUrl>
-#include <QTextDocument> // For Qt::escape
+#endif
+#include <QTextDocument> // for Qt::mightBeRichText
 #include <QAbstractItemView>
 #include <QClipboard>
 #include <QFileDialog>
@@ -86,7 +90,13 @@
     SendCoinsRecipient rv;
     rv.address = uri.path();
     rv.amount = 0;
+
+#if QT_VERSION < 0x050000
     QList<QPair<QString, QString> > items = uri.queryItems();
+#else
+    QUrlQuery uriQuery(uri);
+    QList<QPair<QString, QString> > items = uriQuery.queryItems();
+#endif
     for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
     {
         bool fShouldReturnFalse = false;
@@ -139,7 +149,11 @@
 
 QString HtmlEscape(const QString& str, bool fMultiLine)
 {
+#if QT_VERSION < 0x050000
     QString escaped = Qt::escape(str);
+#else
+    QString escaped = str.toHtmlEscaped();
+#endif
     if(fMultiLine)
     {
         escaped = escaped.replace("\n", "<br>\n");
@@ -176,7 +190,11 @@
     QString myDir;
     if(dir.isEmpty()) // Default to user documents location
     {
+#if QT_VERSION < 0x050000
         myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+#else
+        myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
+#endif
     }
     else
     {
--- qt/paymentserver.cpp Thu Dec 05 13:11:26 2013
+++ qt/paymentserver.cpp Tue Dec 31 02:25:11 2013
@@ -18,7 +18,9 @@
 #include <QLocalServer>
 #include <QLocalSocket>
 #include <QStringList>
+#if QT_VERSION < 0x050000
 #include <QUrl>
+#endif
 
 using namespace boost;
 
--- qt/qrcodedialog.cpp Thu Dec 05 13:11:26 2013
+++ qt/qrcodedialog.cpp Tue Dec 31 02:25:11 2013
@@ -7,7 +7,9 @@
 #include "optionsmodel.h"
 
 #include <QPixmap>
+#if QT_VERSION < 0x050000
 #include <QUrl>
+#endif
 
 #include <qrencode.h>
 
--- qt/rpcconsole.cpp Thu Dec 05 13:11:26 2013
+++ qt/rpcconsole.cpp Tue Dec 31 02:25:11 2013
@@ -8,7 +8,9 @@
 #include <QTime>
 #include <QThread>
 #include <QKeyEvent>
+#if QT_VERSION < 0x050000
 #include <QUrl>
+#endif
 #include <QScrollBar>
 
 #include <openssl/crypto.h>
--- qt/sendcoinsdialog.cpp Thu Dec 05 13:11:26 2013
+++ qt/sendcoinsdialog.cpp Tue Dec 31 02:25:11 2013
@@ -93,7 +93,11 @@
     QStringList formatted;
     foreach(const SendCoinsRecipient &rcp, recipients)
     {
+#if QT_VERSION < 0x050000
         formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), Qt::escape(rcp.label), rcp.address));
+#else
+        formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), rcp.label.toHtmlEscaped(), rcp.address));
+#endif
     }
 
     fNewRecipientAllowed = false;
--- qt/transactionview.cpp Thu Dec 05 13:11:26 2013
+++ qt/transactionview.cpp Tue Dec 31 02:25:11 2013
@@ -176,7 +176,11 @@
         transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Status, 23);
         transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Date, 120);
         transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Type, 120);
+#if QT_VERSION < 0x050000
         transactionView->horizontalHeader()->setResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch);
+#else
+        transactionView->horizontalHeader()->setSectionResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch);
+#endif
         transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Amount, 100);
     }
 }
--- qt/walletview.cpp Thu Dec 05 13:11:26 2013
+++ qt/walletview.cpp Tue Dec 31 02:25:11 2013
@@ -21,7 +21,11 @@
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 #include <QAction>
+#if QT_VERSION < 0x050000
 #include <QDesktopServices>
+#else
+#include <QStandardPaths>
+#endif
 #include <QFileDialog>
 #include <QPushButton>
 
@@ -233,7 +237,11 @@
 
 void WalletView::backupWallet()
 {
+#if QT_VERSION < 0x050000
     QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+#else
+    QString saveDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
+#endif
     QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)"));
     if (!filename.isEmpty()) {
         if (!walletModel->backupWallet(filename)) {

From a windows command prompt configure and make:
Code:
set PATH=%PATH%;C:\Qt\5.2.1\bin
cd C:\bitcoin-0.8.6\
qmake "USE_QRCODE=1" "USE_UPNP=1" "USE_IPV6=1" bitcoin-qt.pro
mingw32-make -f Makefile.Release





Last updated on 8/4/2014: updated to bitcoin 0.9.1 and openssl 1.0.1g

BTC: 1NWQ4TarCCC7j1XY26KRFFEtLYbPP6S3DH
XRP: rJkbeyRaUYDmcukEyLYVfn56QDM9VhybZG
1397941206
Hero Member
*
Offline Offline

Posts: 1397941206

View Profile Personal Message (Offline)

Ignore
1397941206
Reply with quote  #2

1397941206
Report to moderator
1397941206
Hero Member
*
Offline Offline

Posts: 1397941206

View Profile Personal Message (Offline)

Ignore
1397941206
Reply with quote  #2

1397941206
Report to moderator
Buy a Blade, Get a 5-Chip Free!
Start Mining with GAWMiners.com
24/7 Live Phone & Tech Support
Free Hosting & Electricity for 1 Year!

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1397941206
Hero Member
*
Offline Offline

Posts: 1397941206

View Profile Personal Message (Offline)

Ignore
1397941206
Reply with quote  #2

1397941206
Report to moderator
1397941206
Hero Member
*
Offline Offline

Posts: 1397941206

View Profile Personal Message (Offline)

Ignore
1397941206
Reply with quote  #2

1397941206
Report to moderator
1397941206
Hero Member
*
Offline Offline

Posts: 1397941206

View Profile Personal Message (Offline)

Ignore
1397941206
Reply with quote  #2

1397941206
Report to moderator
1397941206
Hero Member
*
Offline Offline

Posts: 1397941206

View Profile Personal Message (Offline)

Ignore
1397941206
Reply with quote  #2

1397941206
Report to moderator
zeph97
Newbie
*
Offline Offline

Activity: 2


View Profile

Ignore
April 08, 2013, 02:27:08 PM
 #2

It works... Thanks for writing this guide.
grue
Staff
Hero Member
*****
Offline Offline

Activity: 1036


It is pitch black. You are likely to be eaten by a grue.


View Profile

Ignore
April 12, 2013, 12:21:20 AM
 #3

Great guide. Now that you're not a newbie anymore, consider moving it to "Development & Technical Discussion" so it doesn't get buried with all the other newbie threads. Also, is it possible to expand your guide to include building the qt client?

1ELvnrA6PhUyDBS6iR25K1Xx4xXL6VMfJX
nitrogenetics
Member
**
Offline Offline

Activity: 80



View Profile

Ignore
April 15, 2013, 09:47:17 PM
 #4

Unfortunately I never tried building the qt client, I'll see if I can have a look at it and report back if I manage to build it successfully Wink

BTC: 1NWQ4TarCCC7j1XY26KRFFEtLYbPP6S3DH
XRP: rJkbeyRaUYDmcukEyLYVfn56QDM9VhybZG
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 630

No Maps for These Territories


View Profile

Ignore
April 16, 2013, 04:14:11 PM
 #5

Please update the build-msw.txt Smiley

Bitcoin Core developer [PGP]  Tips: 1L125pF2e7himW43Qu752ZFLtBLicxQmng Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Remember remember the 5th of November
Hero Member
*****
Offline Offline

Activity: 896

Remember me


View Profile

Ignore
April 16, 2013, 04:19:00 PM
 #6

It's possible to compile Bitcoin-Qt as well, done it already. Depending on your toolchain(GCC 4.7+), you may need to compile the Qt libraries from source, only takes about an hour or so. Then the rest is easy.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
Garr255
Hero Member
*****
Offline Offline

Activity: 868


What's a GPU?


View Profile WWW

Ignore
April 17, 2013, 06:53:26 AM
 #7

Thanks for this. I sent you a tip Wink

http://cognitivemining.com/
 “First they ignore you, then they laugh at you, then they fight you, then you win.”  -- Mahatma Gandhi
nitrogenetics
Member
**
Offline Offline

Activity: 80



View Profile

Ignore
April 18, 2013, 08:16:08 PM
 #8

Thanks for this. I sent you a tip Wink

Thanks, much appreciated  Wink

It's possible to compile Bitcoin-Qt as well, done it already. Depending on your toolchain(GCC 4.7+), you may need to compile the Qt libraries from source, only takes about an hour or so. Then the rest is easy.

Building a dinamically linked executable was almost straightforward (didn't have time to check if it actually works), however I was unable to get a statically linked executable (lots of undefined references from ld) after compiling static qt libs. Need to investigate further.
I will update the first post with the required steps in the next few days.


BTC: 1NWQ4TarCCC7j1XY26KRFFEtLYbPP6S3DH
XRP: rJkbeyRaUYDmcukEyLYVfn56QDM9VhybZG
nitrogenetics
Member
**
Offline Offline

Activity: 80



View Profile

Ignore
April 22, 2013, 11:16:34 PM
 #9

is it possible to expand your guide to include building the qt client?

Bitcoin-qt build instrunctions added Smiley

BTC: 1NWQ4TarCCC7j1XY26KRFFEtLYbPP6S3DH
XRP: rJkbeyRaUYDmcukEyLYVfn56QDM9VhybZG
AlexMerced
Member
**
Offline Offline

Activity: 84



View Profile WWW

Ignore
April 28, 2013, 11:18:06 PM
 #10

is it possible to do this from codeblocks?

grue
Staff
Hero Member
*****
Offline Offline

Activity: 1036


It is pitch black. You are likely to be eaten by a grue.


View Profile

Ignore
April 28, 2013, 11:50:02 PM
 #11

is it possible to do this from codeblocks?
not sure if trolling or just ignorant.

1ELvnrA6PhUyDBS6iR25K1Xx4xXL6VMfJX
AlexMerced
Member
**
Offline Offline

Activity: 84



View Profile WWW

Ignore
April 29, 2013, 12:09:40 AM
 #12

Ignorant, sorry

grue
Staff
Hero Member
*****
Offline Offline

Activity: 1036


It is pitch black. You are likely to be eaten by a grue.


View Profile

Ignore
April 29, 2013, 12:19:50 AM
 #13

Ignorant, sorry
just edit whatever code you want to edit in your IDE, and follow the steps to compile it. And no, there's no easy 1click compile for windows.

1ELvnrA6PhUyDBS6iR25K1Xx4xXL6VMfJX
AlexMerced
Member
**
Offline Offline

Activity: 84



View Profile WWW

Ignore
April 29, 2013, 12:55:51 PM
 #14

I figured out my confusion after some research

Apparently code block uses it's project files in lieu of make files, but there are ways to use make files when compiling in code blocks, go it.

My confusion was when I've compiled stuff using codeblocks I never needed a makefile, but now I see why. I just got my hands on VS12 so eventually I'll have to learn how to use that.

Apologize, I havn't done C++ in 10 years since college and back in those days I used a borland compiler on a unix server and never did anything that complex.

Right now I'm re-learning everything and getting a crash course in Programming, Cryptography and Bitcoin source code. Although I have learned a lot in a short period of time although this project will take awhile but my current goal is to successfully compile Litecoin so I can see how it's done, then understand the genesis block code which I conceptually am starting to get now it's just a matter of seeing how it translates in code.

(spent the weekend reading on the history and concept of proof of work, etc.)

CIYAM
Hero Member
*****
Offline Offline

Activity: 910


Ian Knowles - CIYAM Lead Developer


View Profile WWW

Ignore
April 29, 2013, 01:05:38 PM
 #15

Apologize, I havn't done C++ in 10 years since college and back in those days I used a borland compiler on a unix server and never did anything that complex.

Borland *compiler* on unix?

Are you perhaps referring to the C++ BuilderX environment (which is *not* a compiler)?

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
AlexMerced
Member
**
Offline Offline

Activity: 84



View Profile WWW

Ignore
April 29, 2013, 01:41:15 PM
 #16

probably, again, ignorance

I'm trying to fix it though, once I start learning something I usually get obsessed until I know everything so give me a couple of months and we'll see what I'm at.

grue
Staff
Hero Member
*****
Offline Offline

Activity: 1036


It is pitch black. You are likely to be eaten by a grue.


View Profile

Ignore
April 29, 2013, 02:08:37 PM
 #17

My confusion was when I've compiled stuff using codeblocks I never needed a makefile, but now I see why. I just got my hands on VS12 so eventually I'll have to learn how to use that.
VC++ uses "project" files as well, but they have support for msbuild makefiles. keep in mind that the makefiles included with bitcoin are not msbuild compatible.

1ELvnrA6PhUyDBS6iR25K1Xx4xXL6VMfJX
AlexMerced
Member
**
Offline Offline

Activity: 84



View Profile WWW

Ignore
April 29, 2013, 02:15:09 PM
 #18

thanks, I'll play with that, I want to get gitian builder setup in my VMbox but I'm not sure how to install it from the source (I assume you compile, but as you can see I'm learning about compiling at the moment making it hard for me to install gitian)

wiggi
Full Member
***
Offline Offline

Activity: 153


View Profile

Ignore
April 29, 2013, 02:19:35 PM
 #19

is it possible to do this from codeblocks?

The Qt Sdk from Nokia is actually a very good IDE (the best free-as-in-beer one, I think),
and because bitcoin code comes with the project file for it, you should use it for editing.
grue
Staff
Hero Member
*****
Offline Offline

Activity: 1036


It is pitch black. You are likely to be eaten by a grue.


View Profile

Ignore
April 29, 2013, 02:28:37 PM
 #20

thanks, I'll play with that, I want to get gitian builder setup in my VMbox but I'm not sure how to install it from the source (I assume you compile, but as you can see I'm learning about compiling at the moment making it hard for me to install gitian)
gitian is pretty easy. it sets up the vm, installs all the packages needed for compilation, and compiles it. It's all done inside a vm with scripts (included with bitcoin), so it's actually easier than compiling using your own tools.

1ELvnrA6PhUyDBS6iR25K1Xx4xXL6VMfJX
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!