On 2011-07-19 10:16, Johannes Pfau wrote:
I'd have to test that, but I doubt it will work. This will help to find
the library at compile time, but not at runtime. The runtime linker
will only search in directories listed in /etc/ld.so.conf.d or in the
LD_LIBRARY_PATH variable. Each .so library has a 'soname' embedded. If
you link like in your example command the resulting binary only
contains the sonames of the libraries it needs, not the full path. At
runtime, the linker then reads that soname and searches in its cache for
a library with the same soname. It might be possible to make this
soname mechanism use absolute paths or subdirectories, but this seems
like a hack. Sonames are usually just "libfoo.so.3" where 3 is a ABI
revision. I think we'll eventually have to install shared libraries
exactly the way C does it, i.e all in /usr/lib and using the soname
versioning. But we can think about that when dmd finally supports
shared libraries on linux, it's not important right now.


Oh, at runtime, didn't think of that :). The above command is only for compile time. What about the linker flag "-rpath"? That seems it could be used. Linux is not the only OS, it's easy to add support for dynamic libraries on Mac OS X. All code is already in druntime, it just needs to be enabled. Tango already supports this.

--
/Jacob Carlborg

Reply via email to