To build and use a linked library:
A static library is a collection of object file obj, a static library extension name. A static library generated by Ar-rcs
Static Library Benefits:
1, do not recompile the library code, re-link, save the compilation process time
2, developers can provide library files to use the personnel, not open source
3, generate a static link library, or add an obj file to a static library that already exists
AR library file name. A obj file 1 obj file 2 obj file n+
The most basic step in creating a static library is to generate the target file;
Dynamic Link Library
-soname,libstr.so represents the Build
Dynamic Library alias Libstr.so
Library name is Str
The library prefix is lib, and the suffix name is so
The-o libstr.so.1 option indicates the actual dynamic-link library file that generated the name
-shared tells the compiler to generate a dynamic-link library
Complete command for generating dynamic link libraries based on C source files
Gcc-shared-wl,-soname,libstr.so-o libstr.so.1 C source files need to generate dynamic library;
Creating a dynamic-link library is an important issue to install
Generally speaking, the generated dynamic link library is copied to the system's default dynamic link library's search path, usually/lib,/usr/lib,/usr/local/lib please note with our standard header file
Linux/C + + programming library