0

I created a C++ library, which runs fine on my machine. When I deploy it to another PC, the library fails to load. I checked with dependency walker and discovered some missing dependencies of the form API-MS-WIN-CRT-*-L1-1-0.DLL.

I found out that these files are part of the Universal C Runtime. On my machine, these dependencies were resolved using copies of these DLLs found in my local installation of the Windows Performance Toolkit, or my Visual Studio Installation. Both of these are development tools, that can not be expected be be installed on target machines.

While researching, I have read that the Universal C Runtime is a component of the Windows 10 operating system. So I would expect these necessary dll files to be present somewhere on the system by default, and also included in PATH.

I can find ucrtbase.dll in the System32 folder, which says Microsoft C Runtime Library in its file description.

Do I need to manually include a search path for the API-MS-WIN-CRT-*-L1-1-0.DLL files? Do I have to enable the Universal C Runtime somewhere in the computer's settings? Might something be wrong about how I compiled my library?

TostMaster
  • 164
  • 2
  • 9
  • 1
    Have you installed the correct C++ runtime on the target machine? See : [latest supported vc redist](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) from microsoft. – Pepijn Kramer Jun 12 '23 at 09:07
  • 3
    You are supposed to package [Microsoft Visual C++ Redistributable latest supported downloads](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) with your installer. – Richard Critten Jun 12 '23 at 09:27
  • Also make sure you're using a release build, debug builds aren't redistributable – Alan Birtles Jun 12 '23 at 10:21
  • I solved my problem. It was indeed the vcredist. I needed to install Visual C++ 2010 instead of Visual C++ 2015-2022 – TostMaster Jun 12 '23 at 11:01

0 Answers0