Search code examples
c++templatesuwpdirectx-11c++-winrt

Error Messages using the c++/WinRT Direct3D UWP Game DR template, Direct X11


I'm getting this compiler error when I use this template and I have no idea how to solve it. Standard compiler options. Visual Studio 2019, latest updates installed.

It still compiles but I want to understand it to know if I have to watch out for something.

Error Message :

D:\Windows Kits\10\Include\10.0.18362.0\cppwinrt\winrt\base.h(6508,17): warning C5205: Das Löschen einer abstrakten Klasse "winrt::impl::implements_delegate<winrt::Windows::Foundation::EventHandler<winrt::Windows::UI::Core::BackRequestedEventArgs>,H>" mit einem nicht virtuellen Destruktor führt zu einem nicht definierten Verhalten.
1>        with
1>        [
1>            H=ViewProvider::SetWindow::<lambda_a6c7fb36f57ac2067fa5c75eb2603001>
1>        ]

Solution

  • Those are warnings recently added to the VS 2019 compiler as part of improving C++ standards conformance.

    You can resolve this with any of the following:

    1. Disable two warnings (5204, 5205)
    2. You can disable Conformance Mode (turning off /permissive-) and disable just one warning (5205)
    3. Upgrade to the latest Windows 10 SDK (19041) which is now available.
    4. Or you install the Microsoft.Windows.CppWinRT NuGet package in your project.

    Option #4 is best if you want to use the latest C++/WinRT features, otherwise I'd recommend option #3.