The creation and use of static library and dynamic library

Source: Internet
Author: User

Static libraries: Files in Windows with the suffix. lib, and. a files in Linux;

Dynamic libraries: Files with the suffix. dll in Windows, and. so files in Linux;

In Windows:

Call a static library: Add a static library path-dependent on the static library (or #pragma comment (lib,xx.lib))--Contains header files--and the function in the static library can be called directly from the user program

Invoke Dynamic Library: 1) Static call, implicit invocation: Add library path and header file path-dependent static library option (or #pragma comment (lib,xx.lib))--Contains header file--the function in the dynamic library can be called directly in the user program (Note that it becomes an implicit call to a dynamic library because it is based on a function address in a static library. lib file that is generated while generating the dynamic library.)

2) Dynamic invocation: No action required, just use the Loadlibray_getproaddress_freelibray API directly to manually invoke the API of the dynamic library

The creation and use of static library and dynamic library

Related Article

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.