How to create a .so and .a file in UNIX. Do we have any standard utility for it?
*.a - archive library to create it compile your sources:
gcc -c -o foo.o foo.c
gcc -c -o boo.o boo.c
ar -rsc yourlib.a foo.o boo.o
so - position independent code shared library
gcc -fPIC -shared -soname,libfoo.so.1 -o libfoo.so.1.0 foo.c boo.c
#create shared library
gcc -Os -fPIC -c test.c
gcc -shared test.so test.o
#create static library
gcc -Os -c test.c
ar rcs test.a test.o
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With