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