Problem Description
After configuring an RNW application to use the latest version of cppwinrt (via setting <CppWinRTVersion> version to latest in a Directory.Build.props file), the Microsoft.ReactNative.Cxx project fails to build due to inability to find the function WINRT_IMPL_LoadLibraryW.
It appears that cppwinrt removed the function from base.h and is instead using WINRT_IMPL_LoadLibraryExW now with flags to restrict what directories are loaded (presumably as a security measure).
microsoft/cppwinrt#1293
Steps To Reproduce
- Update native app project to latest cppwinrt NuGet package
- Set CppWinRTVersion property in Directory.Build.props to match cppwinrt version
- Build
Expected Results
Build completes successfully.
Actual:
Build fails due to missing WINRT_IMPL_LoadLibraryW function.
CLI version
npx react-native -v
Environment
npx react-native info
System:
OS: Windows 10 10.0.22621
CPU: (20) x64 Intel(R) Xeon(R) W-2255 CPU @ 3.70GHz
Memory: 40.98 GB / 63.69 GB
Binaries:
Node: 18.5.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.12.1 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.17763.0, 10.0.18362.0, 10.0.19041.0, 10.0.22000.0
IDEs:
Android Studio: Not Found
Visual Studio: 16.11.33801.447 (Visual Studio Enterprise 2019), 17.6.33815.320 (Visual Studio Enterprise 2022)
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: 7.0.3 => 7.0.3
react: 18.0.0 => 18.0.0
react-native: 0.69.3 => 0.69.3
react-native-windows: 0.69.19 => 0.69.19
npmGlobalPackages:
*react-native*: Not Found
Target Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Debug
Snack, code example, screenshot, or link to a repository
No response
Problem Description
After configuring an RNW application to use the latest version of cppwinrt (via setting
<CppWinRTVersion>version to latest in a Directory.Build.props file), the Microsoft.ReactNative.Cxx project fails to build due to inability to find the functionWINRT_IMPL_LoadLibraryW.It appears that cppwinrt removed the function from base.h and is instead using
WINRT_IMPL_LoadLibraryExWnow with flags to restrict what directories are loaded (presumably as a security measure).microsoft/cppwinrt#1293
Steps To Reproduce
Expected Results
Build completes successfully.
Actual:
Build fails due to missing WINRT_IMPL_LoadLibraryW function.
CLI version
npx react-native -v
Environment
npx react-native info System: OS: Windows 10 10.0.22621 CPU: (20) x64 Intel(R) Xeon(R) W-2255 CPU @ 3.70GHz Memory: 40.98 GB / 63.69 GB Binaries: Node: 18.5.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.12.1 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: AllowDevelopmentWithoutDevLicense: Enabled AllowAllTrustedApps: Enabled Versions: 10.0.17763.0, 10.0.18362.0, 10.0.19041.0, 10.0.22000.0 IDEs: Android Studio: Not Found Visual Studio: 16.11.33801.447 (Visual Studio Enterprise 2019), 17.6.33815.320 (Visual Studio Enterprise 2022) Languages: Java: Not Found npmPackages: @react-native-community/cli: 7.0.3 => 7.0.3 react: 18.0.0 => 18.0.0 react-native: 0.69.3 => 0.69.3 react-native-windows: 0.69.19 => 0.69.19 npmGlobalPackages: *react-native*: Not FoundTarget Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Debug
Snack, code example, screenshot, or link to a repository
No response