I created a .so file and put it in the location /opt/lib and added this path to LD_LIBRARY_PATH now after this when I try to compile m
.so
/opt/lib
LD_LIBRARY_PATH
Add -L/opt/lib to your compiler parameters, this makes the compiler and linker search that path for libcalc.so in that folder.
-L/opt/lib
libcalc.so