WinToast icon indicating copy to clipboard operation
WinToast copied to clipboard

compile error (wrl/implements.h: no such file or directory)

Open nikich340 opened this issue 1 year ago • 2 comments
trafficstars

I've added wintoastlib.h and wintoastlib.cpp and linked psapi in CMakeLists to my Qt cmake project, but when trying to compile (even without creating any toast) this error appears. I've checked this repo but haven't found if I should download any additional sources/libs to fix this. OS: Windows 10

D:/QT_projects/TestToast/wintoastlib.h:28:10: fatal error: wrl/implements.h: No such file or directory
   28 | #include <wrl/implements.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
21:45:41: The process "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" exited with code 1.
Error while building/deploying project SimpleAskerServer (kit: Desktop Qt 6.6.1 MinGW 64-bit)
When executing step "Build"

If I remove this include for a test, the same error happens for wrl/event.h and windows.ui.notifications.h.

nikich340 avatar Jan 27 '24 11:01 nikich340

Did you install the Windows SDK in Visual Studio? Open "Visual Studio Installer", install the SDK, and try to see if a simple cpp file that includes the header compiles without error with cl.exe in "Command Prompt for VS 2022".

axoroll7 avatar Oct 05 '24 02:10 axoroll7

For example, on my computer, after following these steps, I can see that this file is found automatically : C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/winrt/wrl/implements.h.

axoroll7 avatar Oct 05 '24 02:10 axoroll7