.exe gives error MSVCP120.dll is missing for Win7x

2019-02-01 15:35发布

问题:

I created .exe using VS2013 and I added it directly to control panel by giving registry path. I built it for x64. It launches perfectly fine for Win8.1x64. But when I launches it on Win7x64 it gives MSVCP120.dll error. If I copy dll it works. But does the dll's are connected directly to .exe? If not how do I attach them?

回答1:

Your error just means that the MSVC redistributable for VS2013 is missing from the Windows 7 computer. Windows 7 doesn't have this DLL by default.

However, please don't copy DLLs around willy-nilly. You need to make sure the redistributable is installed either as part of your installer or separately by the user. For example, you can have your installer detect the existence or not of the redistributable and alert the user to install it. You could include it with your installation package, which is allowed.

Note that there are 2 versions of the redistributable, for x86 and x64. You need to supply the right one(s) for your application. You can use this link to download the Visual C++ redistributable packages for Visual Studio 2013.



回答2:

Even if you're using x64, you need to install also x86 version of MSVC redistributable.

I had this problem myself as well. I found that even after installing x64 version of MSVC redistributable, the msvcp120.dll file was missing in SysWOW64 directory. The issue was solved after installing also x86 version.