What is msvcp140.dll and why is it needed?
The msvcp140.dll file is part of the Microsoft Visual C++ Runtime Libraries (Visual C++ Redistributable). It contains code necessary for programs created with the Visual Studio development environment in C and C++ to run.
When you install an application, it may require a specific version of these libraries. If the required package is not installed on the system or is corrupted, Windows cannot find msvcp140.dll and displays an error on launch.
Typical symptoms:
- Opening a program brings up a window with the text: "The program can't start because msvcp140.dll is missing from your computer."
- The program crashes immediately after launching.
- The error may appear after a Windows update, removal of malware, or a system failure.
Method 1: Install Visual C++ Redistributable (Primary Solution)
This is the correct and safe method recommended by Microsoft. You install the official package that adds the missing libraries to the system directories.
Step 1: Download the package
- Open your browser and go to the official Visual C++ Redistributable download page for x86 (32-bit) and for x64 (64-bit).
- Download both files if you have 64-bit Windows (most 32-bit programs require both versions). For 32-bit Windows, the x86 version is sufficient.
- Save the files to a convenient folder (e.g.,
Downloads).
Step 2: Install the package
⚠️ Important: Install the packages in order: first x86, then x64 (if you downloaded both).
- Locate the
vc_redist.x86.exefile in theDownloadsfolder. - Right-click → "Run as administrator".
- In the installer window, click "I accept the license terms" → "Install".
- Wait for completion (a "Installation successful" message will appear).
- Repeat steps 1-4 for the
vc_redist.x64.exefile (if downloaded). - Restart your computer — this is critically important.
After restarting, try launching the problematic application. In 95% of cases, the error disappears.
Method 2: Check System File Integrity
If the error persists after installing the package, your Windows system files may be corrupted. The sfc /scannow command will check and repair them.
- Press
Win + R, typecmd, pressCtrl + Shift + Enter(run as administrator). - In the Command Prompt, enter the command:
sfc /scannow - Press Enter. The process will take 10-20 minutes. Do not close the window.
- After completion (a results message will appear), restart your PC.
💡 Tip: If
sfcdidn't help, run an additional check:DISM /Online /Cleanup-Image /RestoreHealthThis command will restore the system image, after which run
sfc /scannowagain.
Method 3: Update Windows
Critical Windows updates often include the latest versions of Visual C++ libraries. Ensure your system is up to date.
- Open Windows Settings (
Win + I). - Go to "Update & Security" → "Windows Update".
- Click "Check for updates".
- Install all available updates, including optional ones.
- Restart your computer.
Method 4: Restore the DLL from a Trusted Source (Last Resort)
If nothing else worked and you are certain the issue is specifically a missing msvcp140.dll, you can copy the file from another working system with the same version of Windows and architecture.
- On a working PC with the same Windows version, open the
C:\Windows\System32folder (for 64-bit DLLs) andC:\Windows\SysWOW64(for 32-bit DLLs). - Find the
msvcp140.dllfile, copy it to a USB drive. - On the problematic PC, paste the file into the corresponding folder (
System32for 64-bit,SysWOW64for 32-bit). - Right-click the file → "Properties" → "Digital Signatures" tab → verify that the signature is from Microsoft Corporation and is valid.
- Restart the computer.
⚠️ Warning: This method can compromise system integrity. Use it only if other methods fail, and ensure the file comes from a trusted PC.
Why You Shouldn't Download DLLs from Dubious Websites?
Many websites offer to "download msvcp140.dll for free." This is dangerous! Such files:
- Often contain viruses, trojans, or spyware.
- May be incompatible with your version of Windows, causing new errors.
- Violate Microsoft's licensing agreement.
Always use the official redistributable package — it guarantees safety and compatibility.
Preventing the Problem
To avoid the error in the future:
- Regularly install Windows updates.
- Before installing a new program, check its system requirements (they often specify the required Visual C++ version).
- Do not delete files from the
System32andSysWOW64folders. - Use antivirus software with protection against malicious DLL injection.
Frequently Asked Questions (FAQ)
What if the error still appears after installing the redistributable?
Make sure you installed both versions (x86 and x64) on 64-bit Windows. Also, check if the program requires a different version of the package (e.g., for Visual Studio 2013). In that case, download the appropriate redistributable from the Microsoft website.
Can I manually delete msvcp140.dll?
No. The file is part of a system library. Deleting it will cause failures in all programs that depend on it. If the file is corrupted, reinstall the Visual C++ package.
Do I need to install a package for each Visual Studio version?
No. The Visual C++ Redistributable for Visual Studio 2015, 2017, 2019, and 2022 are compatible with each other. Installing the latest version covers all previous ones.
Why did the error appear after uninstalling a program?
Some programs, when uninstalled, can damage or delete shared libraries. In this case, simply reinstall the Visual C++ Redistributable.
How do I check which DLL is missing if the error doesn't specify msvcp140.dll?
Use the Dependency Walker (depends.exe) utility or Windows built-in Event Viewer under "Windows Logs → Application". It will indicate the exact missing file.