I write a library, inside it looks like this:
User program> library> library module
(gcc -shared -fPIC -o liblib.so lib.c module.c)
The module implements certain functions that are used in the library, but I do not want these functions to be used in the user program, they must be static. How to make them static?
If the library will have a header:
static void function(); And in the implementation module:
void function() {...} That will not work. Due to the static header, the header itself loses contact with the body in the module. If you specify static in the module, the library will not see it. Without static in the library, the function will not be static.
extern void function();- Only the names must be given such strange :) so that there is no accidental collision. Then external modules about them will not be suspected ... - Harry