Tag: Call command to generate Conf learning kernel. So through the directory
Static link libraries:
When the user builds the executable, it calls the library file that ends with. A
Dynamic Link library:
A library file that ends in. So/.so.1.xxx is called when the user builds the executable file
The static library file compiles to the executable file at compile time, so you can run it without relying on the static library file, which causes the resulting executable file to be too large.
Static libraries are not included in the executable at compile time, usually at run time, the corresponding dynamic library files need to be copied together to perform normally, but the executable file is generally small.
The shared library generated by. La for Libtool is actually a configuration document. Can be viewed with file or vim.
The. ko file is the dynamic link file suffix used by the Linux kernel and belongs to the module file, which is used to load the kernel module when the Linux system starts.
Create and build a library file
1, gcc-c test.c generate. O Object File
2, Ar-r libtest.a test1.o test2.o generate libtest.a Static library file
3, gcc-wall-fpic-shared test1.c test2.c-o libtest.so generate dynamic library file
4. La Library is generally generated by makefile.
GCC Test.c-o TEST-I/USR/LOCAL/INCLUDE-L/USR/LOCAL/LIB-LA-LB-LC
GCC Test.c-o test-i/usr/local/include/usr/local/lib/liba.a/home/usr/local/lib/libb.a/home/usr/local/libc.a
./configure cflags= "-i/usr/local/include" ldflags= "-l/usr/local/lib" equivalent to export cflags= "$CFLAGS:/usr/local/include" ; Ldflags= "$LDFLAGS:/usr/local/lib"
Multiple static files are linked into a static file:
The structure of the. A file is no different from the. tar file. The x command is solved, a command is added, and the T command list
Suppose A.a, B.A C.A under the/usr/local/lib directory
Mkdir/tmp/libabc
Cd/tmp/libabc
Ar x/usr/local/lib/a.a
Ar X/USR/LOCAL/LIB/B.A
Ar x/usr/local/lib/c.a
Ar Cru LIBABC.A *.o
Ranlib LIBABC.A
Linux Learning--dynamic link library and static link library