swift-win32: error: use of unresolved identifier 'DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2'
I’m getting this error after running the following commands:
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release . -D CMAKE_Swift_FLAGS="-sdk %SDK% -I %SDK%/usr/lib/swift -L %SDK%/usr/lib/swift/%OS%"
ninja -C build SwiftWin32 HelloSwift
I’ve run curl -sL "https://raw.githubusercontent.com/apple/swift/master/stdlib/public/Platform/winsdk.modulemap" -o "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap"
in an administrator Developer prompt and it made no difference.
Is there a different/newer/older modulemap I need to clone?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (12 by maintainers)
Commits related to this issue
- Support: add `DPI_AWARENESS_CONTEXT` constants These are not imported properly by the clang importer. WinSDK provides the constants in 5.3+. Provide definitions for compatibility with 5.2 Issue: #... — committed to compnerd/swift-win32 by compnerd 4 years ago
- Support: add `DPI_AWARENESS_CONTEXT` constants These are not imported properly by the clang importer. WinSDK provides the constants in 5.3+. Provide definitions for compatibility with 5.2 Issue: #... — committed to compnerd/swift-win32 by compnerd 4 years ago
Im planning on making some more improvements to the build, so LMK if you run into issues.
@compnerd figured it out. I needed to place that change in
Sources/Support/WinSDK+Extensions.swift
rather thanSources/Application/Application.swift
since the former importsWinSDK
. It builds now. That’s what you did in the commit; I don’t know how I missed that.Bleh, this is a compatibility issue.
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
doesn’t get pulled in correctly from the clang importer. We should provide a definition for it inWinSDK+Extensions.swift
for compatibility. Thanks for the report!