I'm having trouble "installing" a shared library I download online. The library name is run time access (http://www.runtimeaccess.com/). In the quick start guide, they explain how to use the library using -L when compiling to define the library location and exporting the LD_LIBRARY_PATH env variable after adding the path of the library dir.
First of all why do you need to define the lib location twice? using -L and LD_Library_PATH env variable?

Second part. I'm trying to avoid passing these arguments and also avoiding modification of the LD_LIBRARY_PATH env, so all I have to do is compile like so:

$ gcc myapp.c -lrtadb

so I would like to include the lib as part of the system lib. So I copied the whole rta-0.8.1 folder to /usr/local/lib/rta-0.8.1 and then add a /etc/ld.conf.d/rtadb.conf file containing the path of the library directory /usr/local/lib/rta-0.8.1/src in there.

But I placed the library path as part of the default lib directories in the /etc/ld.so.conf.d/ files.
–
Armen B.Nov 14 '12 at 21:29

1

/etc/ld.conf* is information for the runtime linker ldd, that resolves what shared libraries to load in application address space. ld is a compile time linker - it actually embeds the references to the required symbols into the binary.
–
peterphNov 14 '12 at 21:53

ok that explains it.Thx, But in any case, how can I avoid explicitly defining the library path. example if I use -sdl or -pthead I don't specify the location of the library.
–
Armen B.Nov 14 '12 at 21:58

because they live in "standard" directories (/lib*, /usr/lib*, and probably /usr/local/lib*). If you move your library there, it should start working without the -L option. But be careful about that, since it would likely pollute your system in a sense, that the files would not be owned by any packages (assuming you are using a distribution with a packaging system).
–
peterphNov 14 '12 at 22:11