[MSVC] Bitcoin build failed due to bitcoin\src\fs.h(75,39): error C2039: ‘u8string’: is not a member of ‘std’ with msvc option /c++latest #26444

issue Zhaojun-Liu openend this issue on November 2, 2022
  1. Zhaojun-Liu commented at 8:13 am on November 2, 2022: none

    Recently, we updated the commit of bitcoin for MSVC RWC testing, it failed to build due to the error like below with option /c++latest, could you please help take a look? Thanks.

    0bitcoin\src\fs.h(75,39): error C2039: 'u8string': is not a member of 'std' [F:\gitP\bitcoin\bitcoin\build_msvc\libbitcoin_qt\libbitcoin_qt.vcxproj]
    1       C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\filesystem(39,1): message : see declaration of 'std' [F:\gitP\bitcoin\bitcoin\build_msvc\libbitcoin_qt\libbitcoin_qt.vcxproj]
    

    Expected behavior

    Build successfully.

    Actual behavior

    0bitcoin\src\fs.h(75,39): error C2039: 'u8string': is not a member of 'std' [F:\gitP\bitcoin\bitcoin\build_msvc\libbitcoin_qt\libbitcoin_qt.vcxproj]
    1       C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\filesystem(39,1): message : see declaration of 'std' [F:\gitP\bitcoin\bitcoin\build_msvc\libbitcoin_qt\libbitcoin_qt.vcxproj]
    

    To reproduce

    1. git clone https://github.com/bitcoin/bitcoin F:\gitP\bitcoin\bitcoin
    2. git -C “F:\gitP\bitcoin\bitcoin” fetch –recurse-submodules=no –force
    3. git -C “F:\gitP\bitcoin\bitcoin” reset –hard 43e813cab266eef42e622519836f171f6a18d426
    4. set CL= /std:c++latest
    5. cd F:\gitP\bitcoin\bitcoin\build_msvc
    6. py -3 msvc-autogen.py
    7. set CL=%CL% /D_HAS_DEPRECATED_ALLOCATOR_MEMBERS /D_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING /Zc:char8_t- /D_SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING
    8. set the vcpkg info and run bootstrap-vcpkg.bat and vcpkg integrate install, in my environment, as follows: cd F:\gitP\bitcoin\tools\vcpkg git -C “F:\gitP\bitcoin\tools\vcpkg” clean -xdf bootstrap-vcpkg.bat set path=%cd%;%path% vcpkg integrate install
    9. switch to the directory: cd F:\gitP\bitcoin\bitcoin\build_msvc
    10. msbuild /m /p:Platform=x64 /p:Configuration=Release /p:PlatformToolset=v142 bitcoin.sln /t:Rebuild

    System information

    the commit of Bitcoin: 43e813cab266eef42e622519836f171f6a18d426

    OS: Windows Server 2022 Datacenter 21H2

    Detailed log: build.log

  2. Zhaojun-Liu added the label Bug on Nov 2, 2022
  3. MarcoFalke commented at 8:19 am on November 2, 2022: member
  4. MarcoFalke removed the label Bug on Nov 2, 2022
  5. MarcoFalke added the label Questions and Help on Nov 2, 2022
  6. MarcoFalke commented at 8:23 am on November 2, 2022: member
    Closing for now. Let us know if you have any other questions.
  7. MarcoFalke closed this on Nov 2, 2022

  8. Zhaojun-Liu commented at 8:28 am on November 2, 2022: none
    @MarcoFalke You mean that bitcoin doesn’t support /c++latest, right?
  9. hebasto commented at 8:35 am on November 2, 2022: member

    Detailed log: build.log

    ** Visual Studio 2019 Developer Command Prompt v16.11.20

    From https://github.com/bitcoin/bitcoin/blob/master/build_msvc/README.md:

    Visual Studio 2022 is minimum required to build Bitcoin Core.

  10. MarcoFalke commented at 8:37 am on November 2, 2022: member

    @MarcoFalke You mean that bitcoin doesn’t support /c++latest, right?

    It may happen to work, but the only supported C++ version is the one listed in build_msvc/common.init.vcxproj.in

  11. Zhaojun-Liu commented at 8:38 am on November 2, 2022: none
    @MarcoFalke Ok, I got it. Thanks for the reply.
  12. Zhaojun-Liu commented at 8:52 am on November 2, 2022: none
    @hebasto I noticed that your reply in other issues mentioned that Visual Studio 2022 is minimum required to build Bitcoin Core. In fact, although we are using VS2019, we will use the latest build of msvc to replace the corresponding msvc related files in the vs path before build the code. We will upgrade VS recently, and I will try to build under vs2022 at then, if there are still problems, I will ask for help here again. Thank you for your reply.
  13. hebasto commented at 9:02 am on November 2, 2022: member

    We will upgrade VS recently, and I will try to build under vs2022 at then

    To avoid linker errors, please ensure that dependencies are also built with VS 2022, including Qt stuff.

  14. Zhaojun-Liu commented at 9:03 am on November 2, 2022: none

    We will upgrade VS recently, and I will try to build under vs2022 at then

    To avoid linker errors, please ensure that dependencies are also built with VS 2022, including Qt stuff.

    Ok, I got it.

  15. fanquake locked this on Dec 28, 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: 2024-07-01 10:13 UTC

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