What are the differences between use MFC in a static library and use MFC in a shared DLL?

Source: Internet
Author: User

 

If you select use MFC in a shared DLL,Your compiledProgramDoes not contain the MFC library, so the file will be relatively small, but if your program is directly moved to a machine without MFC installed, it may lead to the failure to find the mfc dll.

If you select use MFC in a static library,Then, the compiled program directly contains the library that calls the MFC. The file may be larger, but it can be directly moved to other machines for running.

The former is a dynamic connection,Release the DLL file with MFC.

The latter is a static link,Release DLL files without MFC.

If there is only one executable file, use the former, and the execution speed is high, but the file size is relatively large.
If there are multiple executable files, use the latter,Because DLL files are shared, the total volume of files is reduced.
A single file is also small. Load execution blocks, but the running speed is slightly slower than the former.

Used in a static Library:
Use the Lib file. Lib is a compiled binary file that can be statically linked with your project to become an EXE.
Used in a shared dll:
Using the DLL file, the function is hidden inside the DLL file. After your project is compiled into an EXE file, the DLL is called during running.

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.