Bitcoin failed to build with error MSB3073 on MSVC #26324

issue fangzhouxia openend this issue on October 17, 2022
  1. fangzhouxia commented at 9:40 am on October 17, 2022: none

    Expected behavior Build successfully.

    Actual behavior Hi all, Bitcoin fails to build on MSVC due to error MSB3073, the same problem also appeared in vs2019, I mentioned a same issue but it was closed. Could you help look?

    error message 23>F:\gitP\bitcoin\bitcoin\build_msvc\libbitcoin_qt\libbitcoin_qt.vcxproj(161,5): error MSB3073: The command “C:\Qt_static\bin\moc.exe “....\src\qt\bitcoinamountfield.cpp” -o .\QtGeneratedFiles\qt\bitcoinamountfield.moc” exited with code 3. 23>Done Building Project “F:\gitP\bitcoin\bitcoin\build_msvc\libbitcoin_qt\libbitcoin_qt.vcxproj” (Rebuild target(s)) – FAILED. detail log build (27).log

    To reproduce

    1. set VSCMD_SKIP_SENDTELEMETRY=1 & “C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat” -host_arch=amd64 -arch=amd64
    2. git clone https://github.com/bitcoin/bitcoin F:\bitcoin\bitcoin
    3. cd F:\bitcoin\bitcoin\build_msvc
    4. py -3 msvc-autogen.py
    5. cd F:\bitcoin
    6. mkdir tools\vcpkg
    7. git clone https://github.com/microsoft/vcpkg F:\bitcoin\tools\vcpkg
    8. cd F:\bitcoin\tools\vcpkg
    9. bootstrap-vcpkg.bat 2>&1
    10. set path=%cd%;%path%
    11. vcpkg integrate install 2>&1
    12. cd F:\bitcoin\bitcoin\build_msvc
    13. msbuild /m /p:Platform=x64 /p:Configuration=Release bitcoin.sln /t:Rebuild 2>&1

    System information VS version: VS2022(17.3.6) Operating system: windows server 2019 the commit of Bitcoin we use is 5174a13

  2. fangzhouxia added the label Bug on Oct 17, 2022
  3. hebasto added the label Windows on Oct 17, 2022
  4. hebasto commented at 10:45 am on October 17, 2022: member

    System information VS version: VS2022(17.3.6)

    Your log mentions a different VS:

    0Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
    1**********************************************************************
    2** Visual Studio 2019 Developer Command Prompt v16.11.18
    3** Copyright (c) 2021 Microsoft Corporation
    4**********************************************************************
    

    Do you have some VS version installed simultaneously?

    You must ensure that Qt static library and the bitcoin.sln are been built with the same toolchain.

    the commit of Bitcoin we use is 5174a13

    What if you try the recent master branch?

  5. hebasto commented at 10:49 am on October 17, 2022: member
    Also it would be useful to see a log after building with the -verbosity:diag command-line switch.
  6. fangzhouxia commented at 3:17 am on October 20, 2022: none
    After taking the above method, this error still exists. image
  7. hebasto commented at 9:09 am on October 20, 2022: member

    @fangzhouxia

    Mind posting some logs, not only errors?

    Mind providing more details, in particular mentioned in #26324 (comment)?

    Our CI follows https://github.com/bitcoin/bitcoin/blob/master/build_msvc/README.md, and builds Windows binaries just fine. So my guess is the problem is with your building environment. I doubt if we can help with no or little details which could at least help us to reproduce the issue.

  8. fangzhouxia commented at 6:54 am on October 21, 2022: none

    Below are my steps to reproduce:

    1. Open VS2022 x64 Native Tools command.
    2. git clone https://github.com/bitcoin/bitcoin F:\bitcoin\bitcoin
    3. cd F:\bitcoin\bitcoin\build_msvc
    4. py -3 msvc-autogen.py
    5. cd F:\bitcoin
    6. mkdir tools\vcpkg
    7. git clone https://github.com/microsoft/vcpkg F:\bitcoin\tools\vcpkg
    8. cd F:\bitcoin\tools\vcpkg
    9. bootstrap-vcpkg.bat
    10. set path=%cd%;%path%
    11. vcpkg integrate install
    12. cd F:\bitcoin\bitcoin\build_msvc
    13. msbuild /m /p:Platform=x64 /p:Configuration=Release bitcoin.sln /t:Rebuild
  9. hebasto commented at 10:29 am on October 24, 2022: member

    @fangzhouxia

    You must ensure that Qt static library and the bitcoin.sln are been built with the same toolchain.

    Could you try to re-build your Qt static library from scratch using VS2022?

  10. fanquake commented at 8:15 am on November 1, 2022: member
    @fangzhouxia did the above work for you? Is this still an issue?
  11. maflcko closed this on Nov 2, 2022

  12. bitcoin locked this on Nov 2, 2023

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-12-30 15:12 UTC

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