[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Probleme while loading libtool library
From: |
Peter O'Gorman |
Subject: |
Re: Probleme while loading libtool library |
Date: |
Wed, 13 Jun 2007 08:43:56 -0700 |
On Jun 13, 2007, at 2:58 AM, Laurent Marzullo wrote:
Hello,
I'm currently writing a program which load (with lt_dlopen) a
libtool library
called 'liborapi.so'.
This last library required 'libclntsh.so.10.1' which is an Oracle
10i library.
I've got an XML file where some attribute specify some additionnal
path to add
to LD_LIBRARY_PATH
I've then set this attribute to
1) The path where is located 'libcnltsh.so.10.1'
2) The path where is located 'liborapi.so'
In my c++ program, I then use 'setenv' to modify LD_LIBRARY_PATH
with the 2 path
above (Before doing the setenv, the LD_LIBRARY_PATH does not
countain any of the
directory above).
If I do:
std::cerr << "LD_LIBRARY_PATH = " << getenv( "LD_LIBRARY_PATH" ) <<
'\n'
The dynamic linker tends to look at the environment variables at
application startup only. Setting LD_LIBRARY_PATH in your application
will have no effect on dlopen() et.al. until you exec() something.
People often write wrapper scripts that do nothing but set
LD_LIBRARY_PATH (and their equivalents on other platforms) before
execing the program, another alternative, would be to locate the
library yourself, and pass lt_dlopen() the full path.
Lastly, there exists a libltdl specific search var, LTDL_LIBRARY_PATH,
if you set this and explicitly lt_dlopen() both libraries in the right
order i.e. lt_dlopen("libcnltsh.la") then lt_dlopen("liborapi.la")
should work.
Hope this helps,
Peter
--
Peter O'Gorman
http://pogma.com