-
Notifications
You must be signed in to change notification settings - Fork 247
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
Bug: version 2.0.240111.5 does not work correctly with XAML #1397
Comments
Try cleaning the project before building after upgrading cppwinrt |
I manually cleaned up all the generated files, but I still get the same error, with some linking errors. After I switched back to version 2.0.230706.1, the error disappeared and it built successfully. 1>About.xaml.obj : error LNK2019: unresolved external symbol "public: void __cdecl winrt::Player::implementation::AboutT<struct winrt::Player::implementation::About>::InitializeComponent(void)" (?InitializeComponent@?$AboutT@UAbout@implementation@Player@winrt@@$$V@implementation@Player@winrt@@QEAAXXZ) referenced in function "struct winrt::Player::implementation::About * __cdecl winrt::impl::create_and_initialize<struct winrt::Player::implementation::About>(void)" (??$create_and_initialize@UAbout@implementation@Player@winrt@@$$V@impl@winrt@@YAPEAUAbout@implementation@Player@1@XZ)
1>About.xaml.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl winrt::Player::implementation::AboutT<struct winrt::Player::implementation::About>::Connect(int,struct winrt::Windows::Foundation::IInspectable const &)" (?Connect@?$AboutT@UAbout@implementation@Player@winrt@@$$V@implementation@Player@winrt@@UEAAXHAEBUIInspectable@Foundation@Windows@4@@Z)
1>About.xaml.obj : error LNK2001: unresolved external symbol "public: virtual struct winrt::Microsoft::UI::Xaml::Markup::IComponentConnector __cdecl winrt::Player::implementation::AboutT<struct winrt::Player::implementation::About>::GetBindingConnector(int,struct winrt::Windows::Foundation::IInspectable const &)" (?GetBindingConnector@?$AboutT@UAbout@implementation@Player@winrt@@$$V@implementation@Player@winrt@@UEAA?AUIComponentConnector@Markup@Xaml@UI@Microsoft@4@HAEBUIInspectable@Foundation@Windows@4@@Z)
1>Equalizer.xaml.obj : error LNK2019: unresolved external symbol "public: void __cdecl winrt::Player::implementation::EqualizerT<struct winrt::Player::implementation::Equalizer>::InitializeComponent(void)" (?InitializeComponent@?$EqualizerT@UEqualizer@implementation@Player@winrt@@$$V@implementation@Player@winrt@@QEAAXXZ) referenced in function "struct winrt::Player::implementation::Equalizer * __cdecl winrt::impl::create_and_initialize<struct winrt::Player::implementation::Equalizer>(void)" (??$create_and_initialize@UEqualizer@implementation@Player@winrt@@$$V@impl@winrt@@YAPEAUEqualizer@implementation@Player@1@XZ)
1>Equalizer.xaml.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl winrt::Player::implementation::EqualizerT<struct winrt::Player::implementation::Equalizer>::Connect(int,struct winrt::Windows::Foundation::IInspectable const &)" (?Connect@?$EqualizerT@UEqualizer@implementation@Player@winrt@@$$V@implementation@Player@winrt@@UEAAXHAEBUIInspectable@Foundation@Windows@4@@Z)
1>Equalizer.xaml.obj : error LNK2001: unresolved external symbol "public: virtual struct winrt::Microsoft::UI::Xaml::Markup::IComponentConnector __cdecl winrt::Player::implementation::EqualizerT<struct winrt::Player::implementation::Equalizer>::GetBindingConnector(int,struct winrt::Windows::Foundation::IInspectable const &)" (?GetBindingConnector@?$EqualizerT@UEqualizer@implementation@Player@winrt@@$$V@implementation@Player@winrt@@UEAA?AUIComponentConnector@Markup@Xaml@UI@Microsoft@4@HAEBUIInspectable@Foundation@Windows@4@@Z)
1>InfoListItem.xaml.obj : error LNK2019: unresolved external symbol "public:
... The full MIDL options displayed in VS is /iid "nul" /env x64 /h "nul" /W1 /I"D:\Projects\PlayerWinRT\src\Controls" /I"D:\Projects\PlayerWinRT\src\ViewModels" /I"D:\Projects\PlayerWinRT\src\Pages" /I"D:\Projects\PlayerWinRT\src\Data" /I"D:\Projects\PlayerWinRT\src\" /char signed /enum_class /tlb "x64\Debug\Player.tlb" /ns_prefix /metadata_dir "C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0\windows.foundation.foundationcontract\4.0.0.0" /client none /target "NT60" /notlb /nologo /winrt /dlldata "nul" /server none /proxy "nul" /winmd "x64\Debug\Unmerged\%(Filename).winmd Looks like the custom idl include directories was lost in one of the generation steps. |
For Xaml issues please use this repo: https://github.com/microsoft/microsoft-ui-xaml |
I’ve found it’s due to a change in the nuget/Microsoft.Windows.CppWinRT.targets file from #1381, so it’s unrelated to the XAML repository. |
Yes, but that largely serves to support Xaml and the change was made by the same team. I'd love to help but that's your best bet at getting the issue in front of the appropriate developers (they don't monitor this repo). |
@YexuanXiao I'd be glad to take a look at a repro project, if you have one |
I have a repository that replicates the problem: https://github.com/yexuanXiao/PlayerWinRT |
@YexuanXiao thank you for the repro. A fix has been made to CppWinRT: #1404 |
Fix has been published: https://www.nuget.org/packages/Microsoft.Windows.CppWinRT/2.0.240405.15 |
Version
2.0.240111.5
Summary
After I upgraded the C++/WinRT version, my WinUI3 project failed to build. After switching to the previous version, it built normally.
WindowsAppSDK v1.5.240311000
SDK.BuildTools v10.0.26031-preview
Reproducible example
No response
Expected behavior
No response
Actual behavior
No response
Additional comments
No response
The text was updated successfully, but these errors were encountered: