What is the difference between using MFC in a Static Library and the use of MFC in a Shared DLL?

Source: Internet
Author: User

If you choose to use the MFC in a Shared DLL, your compiled program does not contain the MFC libraries, so the files will be small, but if your program moves directly to a machine that does not have MFC installed, it may cause MFC DLLs to be found.

If you choose to use the MFC in a Static library, then your compiled program directly contains the library that calls the parts of MFC, the file may be larger, but can be moved directly to other machines to run.

The former is a dynamic connection, releasing the DLL file to take with MFC.

The latter is a static link that publishes DLL files without MFC.

If the executable file has only one, using the former, the execution speed is fast, but the file is larger.
If the executable file is multiple, use the latter because the DLL file is shared, so the total file volume is reduced.
A single file is also small. Load the execution block, but run slower than the former.

Used in a static library:
Use Lib files. Lib is a compiled binary file that can be statically linked with your project to become an EXE.
Used in a shared DLL:
Using a DLL file, the function implementation is hidden inside the DLL file, and your project is compiled into an EXE file, and the DLL is called by the runtime.

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.