You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bitcoin/build_msvc
Hennadii Stepanov dcb7af053d
Ignore only auto-generated .vcxproj files
5 years ago
..
bench_bitcoin Added libtest_util library to msvc build configuration. 5 years ago
bitcoin-cli
bitcoin-qt Ignore msvc linker warning and update to msvc build instructions. 5 years ago
bitcoin-tx
bitcoin-wallet
bitcoind
libbitcoin_cli
libbitcoin_common
libbitcoin_crypto
libbitcoin_qt Added libbitcoin_qt and bitcoin-qt to the msbuild configuration. 5 years ago
libbitcoin_server
libbitcoin_util
libbitcoin_wallet
libbitcoin_wallet_tool
libbitcoin_zmq
libbitcoinconsensus
libleveldb build: Disable msvc warning 4722 for leveldb build 5 years ago
libsecp256k1
libtest_util Added libtest_util library to msvc build configuration. 5 years ago
libunivalue
msbuild/tasks
test_bitcoin build: Fix appveyor test_bitcoin build of *.raw 5 years ago
test_bitcoin-qt Ignore msvc linker warning and update to msvc build instructions. 5 years ago
testconsensus scripted-diff: Add missed copyright headers 5 years ago
.gitignore Ignore only auto-generated .vcxproj files 5 years ago
README.md Ignore msvc linker warning and update to msvc build instructions. 5 years ago
bitcoin.sln Included test_bitcoin-qt in msvc build. 5 years ago
bitcoin_config.h build: remove configure checks for win libraries we don't link against 5 years ago
common.init.vcxproj build: remove configure checks for win libraries we don't link against 5 years ago
common.qt.init.vcxproj Updated appveyor config: 5 years ago
common.vcxproj
libsecp256k1_config.h
msvc-autogen.py scripted-diff: Add missed copyright headers 5 years ago
vcpkg-packages.txt Appveyor install libevent[thread] vcpkg 5 years ago

README.md

Building Bitcoin Core with Visual Studio

Introduction

Solution and project files to build the Bitcoin Core applications msbuild or Visual Studio can be found in the build_msvc directory. The build has been tested with Visual Studio 2017 and 2019.

Building with Visual Studio is an alternative to the Linux based cross-compiler build.

Quick Start

The minimal steps required to build Bitcoin Core with the msbuild toolchain are below. More detailed instructions are contained in the following sections.

vcpkg install --triplet x64-windows-static berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent[thread] rapidcheck zeromq double-conversion
py -3 build_msvc\msvc-autogen.py
msbuild /m build_msvc\bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build

Dependencies

A number of open source libraries are required in order to be able to build Bitcoin Core.

Options for installing the dependencies in a Visual Studio compatible manner are:

  • Use Microsoft's vcpkg to download the source packages and build locally. This is the recommended approach.
  • Download the source code, build each dependency, add the required include paths, link libraries and binary tools to the Visual Studio project files.
  • Use nuget packages with the understanding that any binary files have been compiled by an untrusted third party.

The external dependencies required for building are:

  • Berkeley DB
  • Boost
  • DoubleConversion
  • libevent
  • Qt5
  • RapidCheck
  • ZeroMQ

Qt

In order to build the Bitcoin Core a static build of Qt is required. The runtime library version (e.g. v141, v142) and platform type (x86 or x64) must also match.

Some prebuilt x64 versions of Qt can be downloaded from here. Please be aware these downloads are NOT officially sanctioned by Bitcoin Core and are provided for developer convenience only. They should NOT be used for builds that will be used in a production environment or with real funds.

To determine which Qt prebuilt version to download open the .appveyor.yml file and note the QT_DOWNLOAD_URL. When extracting the zip file the destination path must be set to C:\. This is due to the way that Qt includes, libraries and tools use internal paths.

To build Bitcoin Core without Qt unload or disable the bitcoin-qt, libbitcoin_qt and test_bitcoin-qt projects.

Building

The instructions below use vcpkg to install the dependencies.

  • Install vcpkg.
  • Install the required packages (replace x64 with x86 as required). The list of required packages can be found in the build_msvc\vcpkg-packages.txt file. The PowerShell command below will work if run from the repository root directory and vcpkg is in the path. Alternatively the contents of the packages text file can be pasted in place of the Get-Content cmdlet.
PS >.\vcpkg install --triplet x64-windows-static $(Get-Content -Path build_msvc\vcpkg-packages.txt).split()
  • Use Python to generate *.vcxproj from Makefile
PS >py -3 msvc-autogen.py
  • An optional step is to adjust the settings in the build_msvc directory and the common.init.vcxproj file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set.

  • To build from the command line with the Visual Studio 2017 toolchain use:

msbuild /m bitcoin.sln /p:Platform=x64 /p:Configuration=Release /p:PlatformToolset=v141 /t:build
  • To build from the command line with the Visual Studio 2019 toolchain use:
msbuild /m bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build
  • Alternatively open the build_msvc\bitcoin.sln file in Visual Studio.

AppVeyor

The .appveyor.yml in the root directory is suitable to perform builds on AppVeyor Continuous Integration servers. The simplest way to perform an AppVeyor build is to fork Bitcoin Core and then configure a new AppVeyor Project pointing to the forked repository.

For safety reasons the Bitcoin Core .appveyor.yml file has the artifact options disabled. The build will be performed but no executable files will be available. To enable artifacts on a forked repository uncomment the lines shown below:

    #- 7z a bitcoin-%APPVEYOR_BUILD_VERSION%.zip %APPVEYOR_BUILD_FOLDER%\build_msvc\%platform%\%configuration%\*.exe
    #- path: bitcoin-%APPVEYOR_BUILD_VERSION%.zip