[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic Linkage Problem
From: |
Ralf Wildenhues |
Subject: |
Re: Dynamic Linkage Problem |
Date: |
Fri, 24 Feb 2006 20:11:10 +0100 |
User-agent: |
Mutt/1.5.9i |
Hi Benjamin, Tommi,
* Benjamin Grauer wrote on Tue, Feb 21, 2006 at 04:42:07PM CET:
>
> i have a problem using automake with Dynamic Library loading (runtime)
This is really a Libtool issue.
> src/program
>
> src/entities/libModule.la
>
> now when i want to link at runtime against src/entities/libModule.la,
> lt_dlopen reports that the file was not found
> what i have to do is supply an absolute path to the lib at runtime....
With
../libtool --mode=execute -dlopen src/entities/libModule.la \
src/program
> since the Programm should be portable, i do not know how to do this in
> a general way.
> e.g:
>
> when developing, the first (library) search path should be ./src/entities/
> when installed, the first search path should be @libdir@/
Right. You can add
-R$libdir
to the link flags for the program, so that it finds the installed
modules. This currently has a drawback, though: on those systems where
the hardcoded run path overrides the shlibpath environment variable
($shlibpath_overrides_runpath=no), above mode=execute line won't get you
the correct uninstalled libraries.
I plan to add sometime an option to specify a run path that should only
be used for the uninstalled executable.
This post (and thread) has a bit more information:
http://article.gmane.org/gmane.comp.gnu.libtool.general/7248
* Tommi Mäkitalo wrote on Wed, Feb 22, 2006 at 08:13:19AM CET:
>
> I do it in my project Tntntet (www.tntnet.org). The problem is, that automake
> does not put your @libdir@ in the search-path. I help myself by setting
> LD_LIBRARY_PATH when developping my programs. The libraries get installed
> into /usr/local/lib or /usr/lib, which are searched automatically, so this is
> not a problem after installation.
Note though that on some systems, the variable in question is not
LD_LIBRARY_PATH.
Cheers,
Ralf