Recently debugging a project, VS2008 MFC system, which used a lot of open source (after debugging the problem that is open source library problem, actually no relationship).
The problem is that the system compiles properly on my machine with vs2008 and then moves to another machine that does not have VS2008 to run.
A series of methods during the debugging process:
1, download VC run the library, after installation, restart, the problem is still in.
2, download VS2008 VC CRT Runtime Library, after installation, restart, the problem still exists.
3, installation VS2008, problem solving "
Note the library in VS2008 is definitely missing.
4, further reduce the cause of the problem,
The problem is solved by installing only the Visual C + + static multithreaded CRT library in the VS2008 installation package.
However, when the release of the installation of the system to customers, it is not possible to install VS2008, so continue to find the reason.
5, consult a great God, find online information, determine the specific reasons.
System Configuration Properties, using MFC in a shared library DLL, differs from using MFC in a static library.
Use of conventional->MFC |
Code Generation-Run library |
Using MFC in a shared DLL |
multithreaded DLLs (/MD) |
Using MFC in a static library |
multithreaded Debugging (/MTD) |
Differences: (1), the use of MFC in the shared library, not the system VC CRT runtime, compiled into the executable file, the executable file is relatively small, but migrated to another computer if the CRT runtime is missing, it cannot be run.
(2), the use of MFC in the static library, is the system VC CRT runtime, in a static way to compile into the executable file, relative to the executable file is relatively large, but ported to another computer, you can not need the CRT runtime, you can directly run.
If it is published, the second is recommended.
Reference site information: http://www.cnblogs.com/lidabo/p/3154680.html
VS2008 generated programs cannot run on other computers, prompting the system not to execute the specified program
http://blog.csdn.net/cqyczw12/article/details/7975172
Vs2008 in MFC with shared DLLs and statically using MFC, Problems encountered