Build with MSVC missing boost dependency #20792

issue tobysharp opened this issue on December 29, 2020
  1. tobysharp commented at 12:26 AM on December 29, 2020: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    While following the build instructions in build_msvc/README.md, I encountered an unexpected missing dependency issue involving e.g. boost/optional.hpp.

    <!--- What behavior did you expect? -->

    The readme file build_msvc/README.md states

    The msbuild project files are configured to automatically install the vcpkg dependencies.

    I was expecting that following the steps listed in this file, I would be able to build Bitcoin Core for Windows using Visual Studio.

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    It seems that the dependencies (or some at least) haven't been automatically installed, as the doc implies. Should they be manually installed? If so, let's amend the build instructions accordingly.

    Here is an example of the compile error. Boost has not been installed at this point.

    1>------ Build started: Project: libbitcoin_wallet, Configuration: Release x64 ------ 1>wallet.cpp 1>D:\dev\bitcoin\src\optional.h(10,10): fatal error C1083: Cannot open include file: 'boost/optional.hpp': No such file or directory 1>Done building project "libbitcoin_wallet.vcxproj" -- FAILED.

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    Cloned from github today.

    git checkout v0.21.0rc3

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    Windows 10 x64 Visual Studio 2019 v 16.7.7

    <!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    Probably just needs an update to the Windows build documentation?

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. tobysharp added the label Bug on Dec 29, 2020
  3. fanquake added the label Windows on Dec 29, 2020
  4. tobysharp commented at 12:10 PM on December 29, 2020: none

    I found more detailed instructions at https://github.com/fanquake/core-review/blob/master/windows.md and will try this to resolve the issue next.

  5. soma42 commented at 12:49 PM on December 29, 2020: none

    @tobysharp try:

    vcpkg install --triplet x64-windows-static berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent[thread] zeromq double-conversion
    vcpkg integrate install
    py -3 build_msvc\msvc-autogen.py
    msbuild /m build_msvc\bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build```
    
    
    also be sure you are actually building x64 and not x86.
    
  6. tobysharp commented at 3:07 PM on December 29, 2020: none

    @soma42 This appears to work just fine. After also downloading the appropriate Qt build, my build completed as expected. Would you like me to submit an edit to the msbuild doc?

  7. soma42 commented at 9:59 PM on December 29, 2020: none

    @tobysharp what I posted to you were the instructions from v0.20. I think since then, changes were made that make this step unnecessary. There may be differences when building with msbuild and from inside Visual Studio 2019. I cannot really say if the new method does or does not work correctly, I'd have to try that on a clean machine.

    It would be better the maintainer of the msvc build looks at this and decides if there is an issue in the build scripts or documentation...

  8. tobysharp commented at 1:21 PM on December 31, 2020: none

    For clarity, I tried the build originally both using the command line and using the Visual Studio IDE, and both methods produced the same errors. After executing the commands given by @soma42 above in the appropriate directories, the build completed fine. The key difference was the two vcpkg lines:

    vcpkg install --triplet x64-windows-static berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent[thread] zeromq double-conversion
    vcpkg integrate install
    

    These should probably be (re-)added to the build_msvc\readme.md file.

  9. adamjonas commented at 9:24 PM on January 14, 2021: member

    @sipsorcery mind taking a look?

  10. sipsorcery commented at 9:49 PM on January 14, 2021: member

    @tobysharp it could be your version of vcpkg is too old. The ability to install the dependencies from a manifest file was only added to vcpkg late last year.

    You can check your version using:

    build_msvc> vcpkg version
    Vcpkg package management program version 2020.11.12-nohash
    
    See LICENSE.txt for license information.
    

    The idea with the manifest file is that instead of needing to manually enter the list of dependencies on the command line you can do:

    build_msvc> vcpkg install --triplet x64-windows-static
    

    If your vcpkg is new enough it should automagically install the dependencies from the vcpkg.json file into the build_msvc\vcpkg_installed directory. This has the added advantage of keeping the dependencies separate from any other vcpkg dependencies you might install in the future (something which does become a problem if you use vcpkg a lot).

    And in fact you don't need to call vcpkg at all since it will add tasks to msbuild to look for a manifest file and call the install command as part of the build.

    If you can confirm whether or not this is your problem I can fix the instructions to note the required vcpkg version.

  11. MarcoFalke commented at 4:50 PM on January 21, 2021: member

    Let me know if this is still an issue

  12. MarcoFalke closed this on Jan 21, 2021

  13. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me