I am trying to create a library (static or shared) that has only a specified functionality accessible for those who use that library.
If I generate the library as follows, all functions implemented in the library are usable from an external application. Can I hide some functions?
gcc -fPIC -g -c -Wall -I/usr/include/extrernalLibDIR modulo1.c
gcc -fPIC -g -c -Wall modulo2.c
gcc -fPIC -g -c -Wall modulo3.c
gcc -shared -Wl,-soname,libMyLib.so.1 -o libMyLib.so.1.0.1 modulo1.o modulo2.o modulo3.o -lc
gcc -g -Wall main.c -o app -I/usr/include/PCSC/ -lMyLib -lpcsclite
And another question: what should I do to avoid having to include a third party library (libpcsclite) that uses my library just created? I wonder if I generate in my library including libpcsclite library.
Pretty grateful!!
Copyright Notice:Content Author:「crossmax」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/24055277/how-to-create-a-library-ansi-c-with-private-functions-in-linux