.so means shared lib.
We call it Dynamic Linking, against Static.
f1.c --->libF1LIB.so
main.c---->libmai.so
Link libmai.so +libF1LIB.so ---> a.out
The very basic facts is:
1. a.out which is the executive, has no storage for f1.so.
When a.out is executed, it will find where f1.so is and loaded at the very executing time.
2. Size:
libF1LIB.so --->7,856 BYTES
libmai.so --> 8144 BYTES
a.out --> 8632 BYTES
We find that 8632 != 8144+7856
It is almost the same size as its libmai.so
3. Move a.out to another directory and still executed OK.
----which means IT remember where it is born and first link address (original libF1LIB.so) and can find that.
4. Delete libF1LIB.so then execute a.out. IT Doesn't work.
--error: can not find libF1LIB.so
5. IF we reserve a libF1LIB.so in directory /lib or /usr/lib then execute a.out. IT works.
--we find It will search first in original directory, and then search the environmental variable PATH's directory.
--It searches the name or the string you input in your CMakeLists.txt or Makefile. Here the name is "libF1LIB.so".
--If "libF1LIB.so" is found, the fill the table of address of "unresolved external symbol" of both Variable and Function.