-
Notifications
You must be signed in to change notification settings - Fork 676
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
WASDK 1.4.231008000 not including <Unknwn.h> before "winrt/base.h" #9014
Comments
You shouldn't have to think of this that strictly. What this really means is that you need to have the classic COM IUnknown defined before including the first of any of the C++/WinRT headers.
With this include order, winrt/base.h sees IUnknown as defined. This happens because Windows.h includes ole2.h by default, and this in turn includes unknwnbase.h. In other words, just including Windows.h before the first C++/WinRT header will normally satisfy this. If you are using |
@StevoSM Did the version of C++/WinRT that your project is using also get downgraded when you rolled back to WinAppSDK 1.3? |
Additionally, can you share a minimal repro project? I'm confused as to why downgrading the version of WinAppSDK being used would affect whether or not your project successfully compiles since to the best of my knowledge this area of the generated code has not been touched in a very long time. |
To provide more context, here are some more details: The issue arises when compiling the generated Using WASDK 1.4,
However, using WASDK 1.3,
We can see from the above that 1.4 is inserting additional includes between @DarranRowe I'm very glad to update my app's includes as needed. Do you know how to make the needed changes that would affect the generated files? @evelynwu-msft All of this is with the latest C++/WinRT - 2.0.230706.1. There's quite a lot in the current Project - I'm not sure how much effort it would take to create a minimal repo project and I expect that may take considerable time. |
This is a Xaml compiler issue, since that is what generates XamlTypeInfo.g.cpp. This means that the minimal reproducible example is the basic C++ WinUI 3 project template followed by disabling the precompiled header in the project properties. @evelynwu-msft |
@DarranRowe Thanks for sleuthing that out. You mentioned you are not using precompiled headers, but are not seeing this same issue. Are you not using XAML in your project, or how is it working for you? I actually turned off precompiled headers as Visual Studio was flagging that it was not included in most of the source files, which is intentional as most of the source files are cross-platform C++ files and precompiled headers are not used on the other platforms. To move this forward for us, we went with the force include, which also required an additional #define in the Project Settings to turn off the min/max macros. |
@DarranRowe That's awesome that you were able to identify the root cause in the source code! @StevoSM Thanks for bringing this to our attention. We'll get this regression addressed as soon as we can. |
@evelynwu-msft Sounds great! Thanks so much! |
@llongley Can you speak to what release contains the fix? |
@StevoSM The fix will be included in the WinAppSDK 1.5 release. |
@evelynwu-msft Great! Thanks! |
I'm just getting started with the WASDK and WinUI 3 so I'm not sure how things should be configured. We have been doing WinUI application development for a couple years, starting with WinUI 2 and most recently transitioning to WinUI 3 1.3.x.
Our project does not use precompiled headers. We have had no problem with building the Project.
However, in updating to 1.4.x, we are getting build errors because "winrt/base.h" is being included before <Unknwn.h>.
We are able to get things to compile by manually adding it in the generated app namespace header. However, since this file is re-generated periodically, it becomes very annoying to build, only to have to update and build again.
We would appreciate direction on how to properly configure our Project so we don't need to do this manually. For now, we have reverted to 1.3.x.
The text was updated successfully, but these errors were encountered: