Linux has two types of function libraries, dynamic libraries and static libraries
Static Library:
This type of library is typically a file with a suffix of. A, and a file compiled with a static library function is larger because all of the data in the library is integrated into the target code.
The compiled execution program does not require external function library support, but it has its drawbacks that once the static function library has changed, the program must be recompiled.
Dynamic Library:
This type of library is generally called. So as the suffix, and in contrast to the static library function library, the dynamic function library is not compiled into the target code. When the program executes to the correlation function, only then calls the function library's corresponding function, therefore the dynamic library function library produces the executable file to be relatively small, because the function library is not to be integrated in the program, therefore this also has less static library lock the shortcoming.
The system default library in Linux system has/lib/usr/lib/usr/local/lib
Whatever library file is generated by the. o file.
Now I'm going to explain the next two kinds of library generation methods and procedures:
Dynamic Library:
Execute the following command on the file that bites the build library:
#gcc-shared Funname.c-o liblibname.so
Static Library:
#gcc-C funname.c
#ar CR Liblibname.a FUNNAME.O
Severity FUNNAME.O is the first step of the file generated