Linux programming dynamic library knowledge, linux programming dynamic
=== Dynamic library description ====
1. Library name format: lib + the_name_of_library +. so + version_number
Exp: libc. so.6
2. ldconfig generally creates soname, but does not create linker name (libname. so ).
3. Temporarily Add the dynamic library directory LD_LIBRARY_PATH for testing and development.
4. LD_PRELOAD: pre-load the library. Used for early loading, emergency use, or special testing
5. Create a dynamic library
Gcc-fPIC-shared-Wl,-soname, your_soname-o library_name \
File_list library_list
6. ldconfig directory Loading Sequence
Run the command in the order of the configuration directory.
If you encounter include ld. so. conf. d/*. conf, these configurations are listed in ascending alphabetical order.
7. When compiling a program or library, the. o file will be included in the program or library, but the dynamic library will not.
Undefined symbols. The search symbols are searched from left to right until they are found. The search is stateless and does not
Records the symbols found, so it is generally recommended that. o be placed before the compilation option, so file is placed behind, according
Dependency order placement: the dependent object is placed on the right of the dependent object