MSVCP140.dll missing

c++, visual-studio-2015, windows

Solution

Either make your friends download the runtime DLL (@Kay's answer), or compile the app with static linking.

In visual studio, go to `Project tab -> properties - > configuration properties -> C/C++ -> Code Generation` on runtime library choose `/MTd` for debug mode and `/MT` for release mode.

This will cause the compiler to embed the runtime into the app. The executable will be significantly bigger, but it will run without any need of runtime dlls.

Problem

I just developed my first program in C++ and I wanted to share it with one of my friends. But when he tries to open the exe it gets an error which says "MSVCP140.dll is missing". Why is this issue happening and how can we fix it?

Original source