ZeroZ30o
ZeroZ30o

Reputation: 396

Is MSVCP140.dll OS/version-dependant?

So I tried to run my program in another computer, as you'd expect from the title, the computer was missing msvcp140.dll - I downloaded it from the internet (didn't have other options at the time) and it didn't work.

Aside from 32-64 bit versions of said .dll, are there different versions for each version of visual studio and/or for each Windows' version (7, 8, 10)? I would rather not have make users install Visual Studio on their computer just for my program.

Upvotes: 3

Views: 2711

Answers (2)

rustyx
rustyx

Reputation: 85481

If you don't want to redistribute MSVC DLLs with your application, you can make a static build of your application.

In Project Settings -> C/C++ -> Code Generation -> Runtime Library -> Select /MT or /MTd (debug)

A statically linked module will not require any MSVC DLLs (other than omp140, if you use OpenMP)

(The downside is that your EXE will become larger)

Upvotes: 1

DevMJ
DevMJ

Reputation: 3061

msvcp140.dll is a Dynamic Link Library (DLL) that is a part of Microsoft Visual C++ component. Your machine might not have the Microsoft redistributable for Visual C++.(I assuming you are using VC++ compiler). Since the other machine does not have MSVS installed, there is no guarantee it has the redist installed. Just install the appropriate redist package from your Visual Studio version to avoid error. msvcp140.dll is Microsoft Visual C++ version dependent.

Upvotes: 3

Related Questions