C++ Library: Windows Crash or Hang During Activation
If your Windows application crashes or hangs during a license call — most often in activateSemiOnline() — while offline checks like validateOffline() keep working, the cause is usually the Visual C++ runtime. Which fix applies depends on which library variant you linked.
MT vs MD: which variant did you link?
The C++ Client Library ships in two Windows runtime variants:
- MT (static runtime): the C++ runtime is linked into your binary. No Visual C++ Redistributable is needed on the end user’s machine. If you use MT, the issue below does not apply.
- MD (dynamic runtime): your application depends on the Visual C++ Redistributable being installed on the end user’s machine. This is the variant where the crash occurs when that redistributable is missing or outdated.
If you are unsure, this crash strongly suggests you are shipping the MD variant.
Why the MD build crashes
The library is built with a recent MSVC toolset (v142 / v143). Some activation paths use the C++ threading runtime (std::thread / std::mutex, provided by CONCRT140.dll / VCRUNTIME140_1.dll), which needs a current Visual C++ Redistributable. An older one can be present but too old: offline-only calls like validateOffline() do not use the threading runtime and still run, so the problem only appears a step later, during activation. Seeing MSVCP140.dll or VCRUNTIME140.dll loaded in the process is not enough — the version matters, and VCRUNTIME140_1.dll in particular ships only with newer redistributables.
The fix
You have two options:
- Update the redistributable. Ask the affected end user to install the latest Microsoft Visual C++ Redistributable (x64): https://aka.ms/vs/17/release/vc_redist.x64.exe — use the x86 build for a 32-bit application. To prevent this for every end user, bundle (or require) it in your own installer.
- Or link the MT (static runtime) variant. This removes the Visual C++ Redistributable dependency entirely, so end users never need it installed.