I get a linkage error 'LINK2019: unresolved external symbol' of the DCompositionCreateDevice function from dcomp.h header, which I believe is a part of Windows SDK and must be reachable out-of-box. Just trivial using of this function leads to the error:
#include <dcomp.h>
int main()
{
DCompositionCreateDevice(nullptr, IID{}, nullptr);
}
The path is C:\Program Files (x86)\Windows Kits\10. Version is 10.0.22621.0 As I checked, in every directory below there is a dcomp.lib file:
Lib\10.0.22621.0\um\arm;
Lib\10.0.22621.0\um\arm64;
Lib\10.0.22621.0\um\x64 (mine, checked the others just in case);
Lib\10.0.22621.0\um\x86;
I thought, maybe I invoked it in the wrong manner, but I can't build my Qt project either (obtained from Conancenter as qt/6.5.1) - a single construction of QApplication in the main leads to the same error.
I updated the version of SDK via the VS Installer from 10.0.20348.0 for Windows 10 to 10.0.22621.0 for Windows 11 - nothing changed. As I continued my attempts, it turned out that all other functions that I tried to invoke from that header led to the same error. Invoking functions from other headers of SDK, including Windows.h, built successfully.
I'm trying to build the project with CMake and MSVC v.143 for x64 and VSCode. Building in VS with .sln files has the same effect.
P.S.: It never led to errors and essentially doesn't make sense to me, but CMake shows this line when configuring
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
but I don't have 10.0.19045 version. I don't know, just notice, maybe it can be related to the problem.
UPD: Apparently, the problem was in my misconception about linking to Windows SDK parts. Like it's said in the comments, I just should've used explicit linkage.