i have created a program in c language to use dynamic libraries with it.
i have a main.c file in which i have created two functions(i.e. just calling those function from the lib.c file where they are fully defined) and lib.c which contain the full function implementation and have a iib.h which contain those two function declarations.
Now i have type the following command
gcc -fPIC -shared -o lib.so lib.c
gcc -o main main.c lib.so
After that i have copied the lib.so file to the /usr/lib directory
But now i am confused how do execute my program in a way that it calls the lib.so file in the /usr/lib at runtime and then my program works.
please help :) .