System Error The program cannot start because MSVCP140_1.dll is missing from your computer. Trying to reinstall the program fixed the issue

Qt series article directory

foreword

I am in windows10 system, use Qt5.15.2 packaging command: windeployqt.exe ImageManageSys.exe, copy ImageManageSys.exe to windows7 system, report error: ImageManageSys.exe - system error This program cannot be started because MSVCP140_1.dll is missing from the computer. Trying to reinstall the program resolved the issue.

insert image description here

1. Solution

When you use windeployqt.exe to package the application on the Windows 10 system, and copy it to the Windows 7 system to run it, you encounter an error that MSVCP140_1.dll is missing. The reason is that the Visual Studio runtime library required for runtime is not installed correctly in the On Windows 7 systems. In order to resolve this issue, please follow the steps below:

Download and install the Visual Studio runtime:
On the Windows 7 computer running your application, download and install the latest Visual C++ Redistributable Package. This will install the necessary runtime libraries for your application.
Please select the appropriate runtime library version according to the system architecture of the target computer:

Visual Studio 2019 x64: https://aka.ms/vs/16/release/vc_redist.x64.exe
Visual Studio 2019 x86: https://aka.ms/vs/16/release/vc_redist.x86.exe
Add manually Runtime files:
If installing the Visual C++ Redistributable Package does not resolve the issue, you can manually add the missing MSVCP140_1.dll file to your application's directory. Copy the MSVCP140_1.dll file from the following path on the development computer (Windows 10):
makefile
Copy code
C:\Windows\System32\MSVCP140_1.dll (for 64-bit applications)
C:\Windows\SysWOW64\MSVCP140_1.dll (for 32-bit application)
copy the MSVCP140_1.dll file to the same directory of the application on the Windows 7 computer, and then try to run the application again.

Check the windeployqt.exe packaging process:
Make sure that when you run windeployqt.exe, the tool has included all required runtime libraries. You can check whether there are files like MSVCP140.dll, MSVCP140_1.dll, etc. in the directory of the application. If not, you may need to manually add these files to your application's directory.
Through the above methods, it should be possible to solve the problem of missing MSVCP140_1.dll encountered when running applications on Windows 7 systems.

In fact, the MSVCP140_1.dll file is part of the Visual C++ runtime library for Visual Studio 2019. To install these runtimes on Windows 7 systems, download and install the Visual C++ Redistributable Package for Visual Studio 2019. The following is the official Microsoft download link:

Visual Studio 2019 x64: https://aka.ms/vs/16/release/vc_redist.x64.exe
Visual Studio 2019 x86: https://aka.ms/vs/16/release/vc_redist.x86.exe
Please refer to Select the appropriate runtime library version for the system architecture of the target computer. After installing this component package, the MSVCP140_1.dll file will be automatically installed in the system directory (such as C:\Windows\System32 or C:\Windows\SysWOW64), and the application should run normally.

Guess you like

Origin blog.csdn.net/aoxuestudy/article/details/130395671