Reprinted please indicate that it is referenced inHttp://blog.csdn.net/chenyujing1234
You are welcome to make a brick!
1. The application background is that vs2008 is successfully compiled in win7 and runs normally. Program : EXE + DLL;
Put it on the XP Virtual Image and run the command: loadlibrary returns 14001.
(1) later I used the"Method 1"Solved.
(2)However, the distribution package corresponding to vs2008 must be installed on the basis of method 1.Vcredist_x86.exe
(This file is provided in the vs2005 installation directory, but not available in vs2008, but can be downloaded online ).
ReferenceArticle:
Http://hi.baidu.com/roger_long/item/867a7cf6fd8cf4cc521c26c5
Ii. Online materials
Some machines have such problems, and some do not! Some controls have no problems, and some have problems. In the past, project managers were responsible for installation and testing, and I never cared about such problems. Currently, companies do not have such full-time positions. Come on your own.
This problem occurs based on experience, and dynamic link DLL is certainly a problem.
1. Use depends on the machine where the control can be used. We found that the CRT was installed to run the program.
2. No CRT is installed on a machine that does not work.
3. Why is there a control that can be run even if no CRT is installed, but all of them are statically connected to the ATL
4. Copy the xp crt dll to 2003, but it still does not work (maybe 2003 is different from the xp crt, and you have not tried it again)
5. Find the answer online. "loadlibrary failed because the application is incorrectly configured and the application failed to start CRT"
========================================================== ==========================================
Solution:
Method 1:
Find the following files in c: \ Program Files \ Microsoft Visual Studio 8 \ Vc \ redist \ debug_nonredist \ x86 \ microsoft. vc80.debugcrt:
Msvcm80d. dll
Msvcp80d. dll
Msvcr80d. dll
Microsoft. vc80.debugcrt. manifest
Copy these files to the target machine,The same folder as the running program or put it under system32To run the program.
For other release versions, the MFC program can copy the files in the corresponding folder under redist, And the folders are marked!
Note:
(1) For vs2008, find the file in the path c: \ Program Files \ Microsoft Visual Studio 9.0 \ Vc \ redist \ debug_nonredist \ x86 \ microsoft. vc90.debugcrt.
(2) If it is placed under system32, you need to change the system environment variable.
Method 2:
Modify the compilation option and change/MD or/MDD to/Mt or/MTD.Static link to the VC Runtime Library, Vc dll is no longer needed at runtime.
Method 3:
Project-> properties-> Configuration properties-> General-> Use of MFC, select "use MFC in static library"
The generated EXE file can be run on other machines.
Method 4:
Find and resend the vcredist_xxx.exe package on your vc8installation disk and install it with your program.
Method 1: The Microsoft. vc80.debugcrt. manifest file was successfully downloaded.
Method 2: This method is the best to adapt to multiple projects.
Method 3: Applicable to MFC
Method 4: relatively large projects are better!
Iii. Expansion
Solution: