Vs2008 in MFC with shared DLLs and statically using MFC, Problems encountered

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.