I am trying to build a shared library. Let us say libabc.so .It uses another .so file , say lib123.so (a lib in /usr/local/lib) .Now i am using my shared lib libabc.so in my
Following the same procedure pointed out by Basile Starynkevitch, for example, I have a library which depends on libm.so, so the compilation for the library objects are:
gcc -fPIC -Wall -g -I include -I src -c src/wavegen.c -o build/arm/wavegen.o
gcc -fPIC -Wall -g -I include -I src -c src/serial.c -o build/arm/serial.o
To compile the library, however, in some versions of gcc the order where library references are placed, is important, so I suggest, to ensure compatibility, placing those references at the end of the command:
gcc -shared -Wl,-soname,libserial.so.1 -o lib/libserial.so.1.0 build/arm/wavegen.o build/arm/serial.o -lm
I have tested in PC (gcc v.8.3.0) and in ARM (gcc v.4.6.3).