Module DLLs and Lib

Source: Internet
Author: User

One, DLL dynamic link library

1.dll No main function

2. Cannot be executed directly, can inject EXE to let it execute indirectly. It is only possible to compile it into the application.

3. Writing DLLs

function preceded by _declspec (dllexport) void Go () {}

Second, Lib (Static link library)

To use LIB, you need to place it in the source file directory.

1. There are two ways of loading lib:

  • Adding LIB libraries to the configuration
  • Code: #pragma comment (lib, "A.lib") although no header file will automatically find the library, but it is better to add a bit better.

2. As a lib theoretically there will be a header file.

A.h
int add (int b, int c)

A.C (compiles him into a lib file a.lib)
int add (int b, int c) {
return b+c;
}

A Lib file is required in the linker to find it himself.

3.no header file in the C language will automatically find the library .

Module DLLs and Lib

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.