This PR allows Bitcoin Core to be relatively easily built with Visual Studio 2017. It’s anticipated that it could be useful for devs familiar with Visual Studio and Microsoft’s tooling. In particular the ability to use the VS debugger is a big benefit.
Caveats:
There are some minor code changes required on Bitcoin Core in order for msvc to be able to successfully compile. I’ll submit them in a separate PR, The code changes are available in #11528 #11558 and #11562.The vcpkg for SECP256K1 has not yet been accepted by Microsoft. The files are available from this PR and should be copied into a vcpkg/ports/secp256k1 directory prior to vcpkg install steps.
Update: For anyone wishing to test out the Visual Studio build with the various open pull requests the steps are:
- Clone and build Vcpkg (Microsoft’s new open source C/C++ package manager)
- git clone https://github.com/Microsoft/vcpkg
- .\bootstrap-vcpkg.bat
- Set up Visual Studio to automatically reference vcpkg installs: .\vcpkg integrate install
- Install the required packages (replace x86 with x64 as required):
- vcpkg install boost:x86-windows-static
- vcpkg install libevent:x86-windows-static
- vcpkg install openssl:x86-windows-static
- vcpkg install zeromq:x86-windows-static
- vcpkg install berkeleydb:x86-windows-static
- vcpkg install secp256k1:x86-windows-static
- vcpkg install leveldb:x86-windows-static
- git clone https://github.com/bitcoin/bitcoin.git
- git checkout -b testbuild
- git pull origin pull/11526/head # Visual Studio build configuration for Bitcoin Core
git pull origin pull/11558/head # Minimal code changes to allow msvc compilationgit pull origin pull/11562/head # bench: use std::chrono rather than gettimeofdayCopy and unzip attached bitcoin-config.h to src/config, edit as required bitcoin-config.zipgit pull origin pull/13031/head # gmtime fix for msvc- Build the Visual Studio solution which, if successful, will result in all but the Qt dependent libraries/programs being built. If the build fails please add a comment.