Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qt5-base:x64-windows] build failure #13566

Closed
BenKey opened this issue Sep 16, 2020 · 21 comments · Fixed by #11776
Closed

[qt5-base:x64-windows] build failure #13566

BenKey opened this issue Sep 16, 2020 · 21 comments · Fixed by #11776
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project

Comments

@BenKey
Copy link
Contributor

BenKey commented Sep 16, 2020

Host Environment

  • OS: Windows 10 Pro 64-bit Version 2004 build 19041.508 with Windows Feature Experience Pack 120.2212.31.0
  • Compiler: Microsoft Visual Studio Community 2019 Version 16.7.3

To Reproduce

Run the following command.

./vcpkg install qt5 qwt qt5[doc] qt5[speech] qt5-winextras --triplet x64-windows

Failure logs

From Console

CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:141 (message):
    Command failed: D:/vcpkg/downloads/tools/jom/jom-1.1.3/jom.exe /J 9
    Working Directory: D:/vcpkg/buildtrees/qt5-base/x64-windows-dbg
    See logs for more information:
      D:\vcpkg\buildtrees\qt5-base\build-x64-windows-dbg-out.log
      D:\vcpkg\buildtrees\qt5-base\build-x64-windows-dbg-err.log

From build-x64-windows-dbg-out.log

qrhid3d11.obj : error LNK2001: unresolved external symbol IID_IDXGIFactory2
qrhid3d11.obj : error LNK2001: unresolved external symbol IID_ID3D11DeviceContext1
qrhid3d11.obj : error LNK2001: unresolved external symbol IID_ID3DUserDefinedAnnotation

Log files

build-x64-windows-dbg-out.log
build-x64-windows-dbg-err.log

@JackBoosY JackBoosY self-assigned this Sep 17, 2020
BenKey added a commit to BenKey/vcpkg that referenced this issue Sep 17, 2020
@JackBoosY
Copy link
Contributor

qrhid3d11.obj : error LNK2001: unresolved external symbol IID_IDXGIFactory2
qrhid3d11.obj : error LNK2001: unresolved external symbol IID_ID3D11DeviceContext1
qrhid3d11.obj : error LNK2001: unresolved external symbol IID_ID3DUserDefinedAnnotation
..\..\lib\Qt5Guid.dll : fatal error LNK1120: 3 unresolved externals

Should be linked with uuid.
cc @Neumann-A

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Sep 17, 2020
@Neumann-A
Copy link
Contributor

@JackBoosY: I still don't know where this error is coming from. So this needs a way to actually reproduce the error.

@JackBoosY JackBoosY added the requires:repro The issue is not currently repro-able label Sep 17, 2020
@BenKey
Copy link
Contributor Author

BenKey commented Sep 18, 2020

I was able to reproduce the issue with the following command.

./vcpkg install qt5 qwt qt5[doc] qt5[speech] qt5-winextras --triplet x64-windows

If you cannot reproduce the issue with that command, then it is possible that there are other packages that contribute to the issue. Try the following command instead.

./vcpkg install directxsdk directxtk12 dx qt5 qwt qt5[doc] qt5[speech] qt5-winextras --triplet x64-windows

@BenKey
Copy link
Contributor Author

BenKey commented Sep 28, 2020

@Neumann-A said.

@JackBoosY: I still don't know where this error is coming from. So this needs a way to actually reproduce the error.

I provided information on how to reproduce this in the original bug report. I simply ran the following command and saw the errors.

./vcpkg install qt5 qwt qt5[doc] qt5[speech] qt5-winextras --triplet x64-windows

When I saw your message I provided additional information 11 days ago. I will repeat my response from 11 days ago and provide a bit more information as explanation.

It is possible that there are other packages that contribute to the issue. Try the following command instead.

./vcpkg install directxsdk directxtk12 dx qt5 qwt qt5[doc] qt5[speech] qt5-winextras --triplet x64-windows

The problem is that the original command was not run in isolation. I already had many other packages installed when I ran the command I mentioned in the original bug report. I can only guess why we are seeing differences in behavior. Since the errors reference DirectX and there are DirectX related packages that were installed before I ran that first command I assume the second one will suffice to reproduce the error.

I provided most of these details 11 days ago and have not seen a response.

Are you still unable to reproduce the issue?

I ask because I have not seen any progress on this issue in 11 days. I saw your comment and the requires:repro tag. I provided addition information, and nothing.

It seems to me that 11 days is more than enough time for someone to say "that worked" or "nope, still cannot reproduce it."

@JackBoosY
Copy link
Contributor

@BenKey Sorry for late, I'll try to reproduce this issue later.

@JackBoosY JackBoosY removed the requires:repro The issue is not currently repro-able label Sep 29, 2020
@JackBoosY
Copy link
Contributor

After run command ./vcpkg install directxsdk directxtk12 dx qt5 qwt qt5[doc] qt5[speech] qt5-winextras --triplet x64-windows, this issue was reproduced:

qrhid3d11.obj : error LNK2001: unresolved external symbol IID_IDXGIFactory2
qrhid3d11.obj : error LNK2001: unresolved external symbol IID_ID3D11DeviceContext1
qrhid3d11.obj : error LNK2001: unresolved external symbol IID_ID3DUserDefinedAnnotation

@BenKey
Copy link
Contributor Author

BenKey commented Sep 29, 2020

@JackBister Thanks.

@JackBoosY
Copy link
Contributor

The symblos IID_IDXGIFactory2 / IID_ID3D11DeviceContext1 / IID_ID3DUserDefinedAnnotation are in dxguid.lib, and it has been declared to be used in SOURCE/src/gui/rih/rhi.pri:

win32 {
    HEADERS += \
        rhi/qrhid3d11_p.h \
        rhi/qrhid3d11_p_p.h
    SOURCES += \
        rhi/qrhid3d11.cpp

    LIBS += -ld3d11 -ldxgi -ldxguid
}

but not in the link command:

link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /SUBSYSTEM:WINDOWS /VERSION:5.15 /MANIFEST:embed /OUT:..\..\lib\Qt5Guid.dll @C:\Users\vzay\AppData\Local\Temp\Qt5Guid.dll.1564.134140.jom

@Neumann-A do you know why it happened?

@Neumann-A
Copy link
Contributor

LIBS += -ld3d11 -ldxgi -ldxguid

should probably be

LIBS += -ld3d11 -ldxgi -ldxguid -luuid

@Neumann-A
Copy link
Contributor

@JackBoosY

but not in the link command:

You have to look into the response file @C:\Users\vzay\AppData\Local\Temp\Qt5Guid.dll.1564.134140.jom to get full cmd line call, switch to nmake ortake a peek into the makefile.

@JackBoosY
Copy link
Contributor

JackBoosY commented Dec 1, 2021

I met this issue again.

After some investigation, I think this issue will repro if port directxsdk is installed first.
This should be because the dx library installed in vcpkg is inconsistent with the dx library in the Windows SDK, and vcpkg first uses the installed library in vcpkg.
It has been confirmed that these symbols do not exist in the dxguid.lib installed by vcpkg.
@BillyONeal Is this a bug of directxsdk?

Edit:
In dxguid.lib which installed by Windows 10 SDK, it has symbols from IID_IDXGIFactory to IID_IDXGIFactory5.
But in dxguid.lib which installed by vcpkg, it only has symbols fom IID_IDXGIFactory to IID_IDXGIFactory1.
So I think the version is mismatch.

@JackBoosY JackBoosY reopened this Dec 1, 2021
@JackBoosY
Copy link
Contributor

@walbourn Do you know the difference between the dxsdk downloaded from the our official website and the dxsdk in the Windows 10 SDK?

@BillyONeal
Copy link
Member

I observe directxsdk is explicitly deprecated in favor of the Windows SDK one and that port prints this message:

message(WARNING "Build ${PORT} is deprecated, untested in CI, and requires the use of the DirectSetup legacy REDIST solution. See https://aka.ms/dxsdk for more information.")

@JackBoosY
Copy link
Contributor

Obviously, qt5 did not process the code according to the version of dxsdk.
@Neumann-A Is there any qt document mentioned this issue?

@walbourn
Copy link
Member

walbourn commented Dec 1, 2021

TL;DR: The only good reason to keep using the legacy DirectX SDK is for Windows XP. This scenario is not supported by the modern Windows SDK (Windows 8 or later) and requires the Windows 7.1A SDK.

@JackBoosY - The legacy DirectX SDK was deprecated back in 2011 as a product and lives on as an 'end-of-life' release with numerous known issues. See Microsoft Docs. Due to the SHA-1 deprecation on Microsoft Downloads, there were impacts early in 2021 on both the legacy DirectX SDK and the legacy DirectX End-User Runtime downloads. See this blog post. That's why I made changes to the community created dxsdk vcpkg port, as well as to provide features to support the guidance in this blog post.

The big problem with the legacy DirectX SDK is that it contains conflicting filenames with the modern Windows SDK. If you get the include order wrong, you'll end up with the old version of the header. That's almost certainly what's happening with dxguid.lib. The copy of dxguid.lib in the legacy DirectX SDK does not contain IID_IDXGIFactory2 or IID_ID3D11DeviceContext1.

A number of technologies were transferred to the Windows 8 OS and Window 8 SDK and live on in the modern Windows SDK:

  • Direct3D 11 headers/libs, Direct3D 10 headers/libs, Direct3D 9 headers/libs, DirectSound headers/libs, DirectInput headers/libs, DirectDraw headers.

See this blog post for a note on why DirectDraw doesn't have a library in the Windows SDK.

  • D3DCompile and D3DCSX APIs are supported in the Windows SDK, and the _46 and _47 DLLs are available to ship side-by-side for Windows 7 support. Those DLLs do NOT support Windows XP. See this blog post. The FXC.EXE HLSL compiler tool was added to the Windows SDK as well.

  • The "xnamath" library from the legacy DirectX SDK was replaced the DirectXMath library which is in the Window SDK. There's also a directxmath vcpkg port which provides the latest version of it. See Microsoft Docs.

  • The XInput headers in the Windows SDK use XInput 1.4 if building for Windows 8 or later, or XInput "9.1.0" if building below that. XInput "9.1.0" is a basic form of XInput that has been in the OS since Windows Vista. XInput 1.3 also has known security bugs, so the strong recommendation is to just stick with the basic gamepad functionality unless you are targeting Windows 8 or later. See this blog post.

  • The XAudio2 headers in the Windows SDK require XAudio 2.8 or XAudio 2.9 which only support Windows 8 or later. We now have a Microsoft.XAudio2.Redist NuGet which offers XAudio 2.9 on Windows 7 or later so you don't need the legacy DXSDK at all for audio. This is exposed with the xaudio2redist vcpkg port. See Microsoft Docs.

  • D3DX9, D3DX10, and D3DX11 are not in the Windows SDK and are officially deprecated. These were the primary reason people still install the legacy DirectX SDK for the past decade. We now have a Microsoft.DXSDK.D3DX NuGet package which both avoids the need to install the legacy DirectX SDK, and includes the required DLLs with a side-by-side license so you can also avoid the legacy DirectX End-User Runtime REDIST. See this blog post. This is exposed by the dxsdk-d3dx vcpkg port.

The strong recommendation is to stop using legacy D3DX entirely. I have put a lot of work into open source replacements for this functionality over the years. That's the directxtk, directxtex, directxmesh, and uvatlas vcpkg ports expose. See this blog post.

@JackBoosY
Copy link
Contributor

@walbourn Thank you for your detailed explanation, I will report this issue to qt.

@JackBoosY
Copy link
Contributor

Upstream issue: https://bugreports.qt.io/browse/QTBUG-99050.

@JackBoosY JackBoosY added the depends:upstream-changes Waiting on a change to the upstream project label Dec 9, 2021
@Neumann-A
Copy link
Contributor

This wont be fixed. 5.15.2 was the last open source release. So unless vcpkg switches to the kde branch for qt5 or adds the patch itself nothing will happen.

@JackBoosY
Copy link
Contributor

@Neumann-A I'm afraid the latest qt version also have this issue.

@mcDandy
Copy link

mcDandy commented Dec 26, 2021

reproducable on windows 11 with wisual studio 17.1 and ninja 1.10.2

@JackBoosY
Copy link
Contributor

Close this PR until upstream fixes this.

meslubi2021 added a commit to meslubi2021/vcpkg that referenced this issue Jul 22, 2024
* Enable building of LLVM. Build arabica.

* Added nasm and yasm to the path. Use CMake version 3.17.2 instead of version 3.14.0.

* Disable installation of llvm since it is broken again.

* Add share\clang to the path.

* Enable llvm.

* Added directories to path. Use Python 3.8.

* Modified the imgui entry in the packageList.

* Added InstallPackagesForLinux.py.

* boost-regex with icu feature is only supported on windows

* Do not build 'boost-locale[icu]'.

* Do not build atkmm or gtkmm. They are not supported in Linux.

* Do not build atk or gtk.

* Do not build chakracore.

* Do not build cppunit.

* Remove packages from the package list that are not supported in Linux.

* Disable installation of llvm because it is currently broken.

* Do not install dlib.

* Use official release of arabica from jezhiggins.

* Fix error with arabica on Windows by defining the following preprocessor symbols: -DCMAKE_CXX_FLAGS=-DARABICA_NO_CODECVT_SPECIALISATIONS=1 -DARABICA_USE_WINSOCK=1 -DARABICA_WINDOWS=1.

* Can't build BoringSSL if OpenSSL is installed.

* Comment out portaudio line until bug is fixed.

* Updates to path.

* Changes to the packageList: 1) Added aixlog, audiofile, berkeleydb, cpu-features, cpu-features[tools], ctbignum, imgui[glfw-binding], and several more SDL2 components. 2) Build SDL2 at the same time as imgui.

* 1) Added the following items to the packageList: 7zip, akali, chromium-base, directxsdk, directxtk12, dx, fruit, function2, glew, hunspell, hunspell[tools], libevent, libevent[thread], libyaml, mimalloc, mimalloc[secure], mpfr, mygui, mygui[opengl], nt-wrapper, numcpp, p-ranav-csv2, phnt, qt5[doc], qt5[speech], qt5-winextras, safeint, tgui, tgui[tool], utf8h, utfcpp, and v8. 2) Added the ability to mark a package as x64 only. 3) Added directories to the path.

* Disable installation of chromium-base until they fix the double_conversion.lib bug.

* Set DICPATH environment variable.

* Added Emacs to path.

* Temporarily disable install of qt5 because of issue microsoft#13566 {[qt5-base:x64-windows] build failure}.

* Minor updates to InstallPackagesForWindows.py and update-env.bat.

* Updates to path.

* Updated InstallPackagesForWindows.py and update-env.bat.

* Updated update-env.bat.

* Minor updates.

* Added vcpkg-env.el.

* Updated the path.

* Updated PATH.

* Various small improvements.

* WIP. Began the process of synchronizing InstallPackagesForLinux.py with InstallPackagesForWindows.py.

* Minor updates.

* Updated packageList.

* Updated vcpkg-env.el.

* Updates to InstallPackagesForWindows.py.

* Updated the package list.

* Updated the path.

* Updates to the install packages scripts.

* Numerous improvements.

* Updated path.

* Updated package list.

* Added uberswitch.

* Install uberswitch.

* Update package list.

* Update packageList. Set JDK_HOME, JDK_HOME_X64, and JDK_HOME_X86. Update path.

* Set env for .NET.

* Added the bt directory.

* Updated packageList.

* Updated PATH.

* Added InstallPackagesForMSYS2.py.

* Updated JDK variables.

* Updated packageList.

* Updated vcpkg-env.el.

* Updated vcpkg--add-to-path-linux.

* Set PANDOC_EXE.

* Updated packageList.

* Updated path and dotnet version.

* Update DOTNET_VERSION, JDK_HOME, JDK_HOME_X64, and JDK_HOME_X86.

* Updated add-to-path-windows.

* Updated DOTNET_VERSION. Added an option to add MSYS64 directories to the path.

* Added clean.bat.

* Updated clean.bat.

* Updated x64OnlyPackageList and packageList.

* Various updates.

* Various updates.

* Trimmed the packageList so that it only includes packages I use actively. This makes updating VCPKG much less time consuming.

* Updated env.

* Minor updates to the packageList.

* No longer attempt to set DICPATH.

* * Import inspect.
* Updated x64OnlyPackageList and packageList.
* Updated the InstallPackagesWorker function.
* Updated path.

* Update path.

* Updates for Java and Python.

* Updated packageList.

* Updated DOTNET_VERSION, JDK_HOME, and JDK_HOME_X64.

* Updated path.

* Update package list.

* Updated the path.

* Set CMAKE_TOOLCHAIN_FILE. Update HOME.

---------

Co-authored-by: Ben Key <bkey76@gmail.com>
Co-authored-by: Benilda Key <bkey@vispero.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants