I am creating an executable with this:
gcc elliptical.o -Llibs -lhfcal -o elliptical
In my libs sub folder there are:
libhfcal.a libhfcal.so
files. My purpose is to use dynamic library but still i didnt understand how it choose .so file when i didnt explicitly refer it. I know it tries to use .so because when running executable i got
./elliptical: error while loading shared libraries: libhfcal.so: cannot open shared object file: No such file or directory
Using static library to create executable command as same as dynamics one. I know i need to use LD_LIBRARY_PATH but my question is why compiler picked up dynamics library?
-lhfcaldoes exactly that, link tolibhfcal.so