microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[cppwinrt] hiddes installtion of winrt from VS

Neumann-A opened this issue · comments

There are only three options here:

  • remove the port or mark it as skipped in CI
  • make everything using cppwinrt use the port (and maybe remove the component from the VS installer; also means UWP probably would need to autoload the port)
  • move stuff into a manual-include/manual-lib folder where it won't get autodetected.

Issues due to cppwinrt being available: #38600
ffmpegmediaplugind.lib(qffmpegwindowcapture_uwp.cpp.obj) : error LNK2038: mismatch detected for 'C++/WinRT version': value '2.0.240111.5' doesn't match value '2.0.220110.5' in Qt6Cored.lib(qlocale_win.cpp.obj)

@Neumann-A, what commit (or other change) caused this to be a problem? The last commit to cppwinrt is commit 3a7cb34 and it is more than six weeks old. And how did the error get through CI?

@tsondergaard: Simply CI is not setup to detect those issues. It basically had always be the problem but is only now visible due to qtinterfaceframework actual linking code which was build with different winrt versions due to the cppwinrt port since it links qtbase and qtmultimedia. It only happens if cppwinrt is installed between the build of qtbase and qtmultimedia.
cppwinrt version is 2.0.240111.5 while the VS installed version in CI is 2.0.220110.5. Qt has a check for winrt since Qt 6.2 looking for include <winrt/base.h>

@Neumann-A The correct fix is as you mentioned to make cppwinrt a dependency of qtbase (or whatever feature) on windows.

Long term fix is your second point (make everything using cppwinrt use the port) and optionally we can have detection logic in the port for a VS install. The point is to let the cppwinrt port choose whether it should find or generate the C++ WinRT headers.

I don't think we can remove the component from VS: the C++ WinRT is part of the Windows SDK workload.