0

I compile a C++ exe with vs2022 on win11, and run it on a win7 device, but the system prompts that a bunch of api-ms-win-core-xxx.dll is missing.

So, I check the documentation, it says these DLLs are introduced after win7, so can I just distribute them with my app?

Suric
  • 53
  • 1
  • 10
  • 2
    Please use the redistributable installer, provided as part of VS2022. It will do the right thing with regards to versioning and perform any registration (if required). See also [Microsoft Visual C++ Redistributable latest supported downloads](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170) – Richard Critten Oct 14 '22 at 17:51
  • 2
    Might not even work (windows 11 dlls on windows 7), try changing your target platform to an older windows sdk and make a build for windows 7 specifically – Pepijn Kramer Oct 14 '22 at 17:52
  • If you deploy your application, then you need to make an installer that also installs the vc-runtime from a microsoft supplied installer. Also do NOT deploy a debug build, you're only licensed to deploy release builds – Pepijn Kramer Oct 14 '22 at 17:55
  • These api-* files contain no code and are just pointless for anyone outside Microsoft for desktop apps. If your app is simple enough you might be able to just link with the classic kernel32 and friends instead. Static linking of the CRT if you are using that. – Anders Oct 15 '22 at 03:35

1 Answers1

1

I suggest you don't try to get these dlls, distributing these files is a violation of the Windows End User Agreement.

According to this issue:

Those DLLs are Windows's implementation detail and are subject to change at anytime. Those files you get from a higher version of Windows won't work if your Windows version is too low. If you are a developer, just use the APIs documented in the Windows SDK (unless absolute necessary like writing antivirus) and do not take any dependency on those dlls, as they may only exist in one Windows version.

Yujian Yao - MSFT
  • 945
  • 1
  • 3
  • 9