How to set Shared library's default path
I am making a shared library in my dir. by giving these commands :
gcc -fPIC -g -c -Wall a.c gcc -shared -Wl,-soname,libmystuff.so.1 \ -o libmystuff.so.1.0.1 a.o -lc Now my real name for the library as libmystuff.so.1.0.1 has been created but where is the soname i am not able to find it. Do i need to create this soname separately as a symbolic link to real name but as i read the soname should be created automatically whereas the linker name i need to create. |
If you want the library to be system-wide accessible, put it in some standart location, like /usr/lib, or /usr/local/lib and then run as root "ldconfig". It will create the necessary symlink and update the linker cache. See it's manpage for more details.
|
Quote:
Now i want to know that if i create this new so library in a local directory and then give the path name after 'ldconfig "PATH"' so what is the use of LD_LIBRARY_PATH. Is it to set the path for compiler to recognize the actual path and if once for a so library we set this will it be same for the other so Libraries made after setting this env variable. |
LD_LIBRARY_PATH is set for the programs that need the library
at runtime rather than the compiler. Cheers, Tink |
All times are GMT -5. The time now is 09:55 AM. |