-
LD_LIBRARY_PATH
Hi ,
I have been looking at [url]http://linuxmafia.com/faq/Admin/ld-lib-path.html[/url]
& the Linux man pages. I am just trying to work out if
LD_LIBRARY_PATH is used at link time or not. I have been told that it
is only used at run time, however if I set it and try to link some of
the link errors seem to resolve themselves. Can some one please
clarify whether or not LD_LIBRARY_PATH is used at both at link and run
time.
Thx
-
Re: LD_LIBRARY_PATH
[email]0infinity0@gmail.com[/email] writes:[color=blue]
> I have been looking at [url]http://linuxmafia.com/faq/Admin/ld-lib-path.html[/url]
> & the Linux man pages. I am just trying to work out if
> LD_LIBRARY_PATH is used at link time or not. I have been told that it
> is only used at run time,[/color]
This is a question which could be answered really easily by having a
look at the documenation instead of relying on 'stories told be other
people' (who probably didn't check the documentation, too).
For this particular case:
The linker uses the following search paths to locate required
shared libraries.
[...]
5. For a native linker, the contents of the environment
variable "LD_LIBRARY_PATH".
[ld(1)]
The Gnu linker is usually the native linker on a Linux-based system,
consequently, it will use this environment variable.
-
Re: LD_LIBRARY_PATH
On Oct 30, 5:53 am, 0infini...@gmail.com wrote:[color=blue]
> Hi ,
>
> I have been looking athttp://linuxmafia.com/faq/Admin/ld-lib-path.html
> & the Linux man pages. I am just trying to work out if
> LD_LIBRARY_PATH is used at link time or not. I have been told that it
> is only used at run time, however if I set it and try to link some of
> the link errors seem to resolve themselves. Can some one please
> clarify whether or not LD_LIBRARY_PATH is used at both at link and run
> time.
>
> Thx[/color]
Hi....
LD_LIBRARY_PATH is used only at run time. The working is as follows,
whenever you set the environment variable LD_LIBRARY_PATH at the time
of execution, this library gets loaded before the executable and its
constructor is executed prior to the control going to the program
start address.
AFAIK, it might be resolving some of your link errors but ya, this is
not the proper use of it.
Thanks & Regards,
Sandeep.
-
Re: LD_LIBRARY_PATH
sandy <sandeepksinha@gmail.com> writes:[color=blue]
> On Oct 30, 5:53 am, 0infini...@gmail.com wrote:[color=green]
>> Hi ,
>>
>> I have been looking athttp://linuxmafia.com/faq/Admin/ld-lib-path.html
>> & the Linux man pages. I am just trying to work out if
>> LD_LIBRARY_PATH is used at link time or not. I have been told that it
>> is only used at run time, however if I set it and try to link some of
>> the link errors seem to resolve themselves. Can some one please
>> clarify whether or not LD_LIBRARY_PATH is used at both at link and run
>> time.
>>
>> Thx[/color]
>
> Hi....
> LD_LIBRARY_PATH is used only at run time.[/color]
This is wrong. RTFM ld.
-
Re: LD_LIBRARY_PATH
[email]0infinity0@gmail.com[/email] wrote:[color=blue]
> Hi ,
>
> I have been looking at [url]http://linuxmafia.com/faq/Admin/ld-lib-path.html[/url]
> & the Linux man pages. I am just trying to work out if
> LD_LIBRARY_PATH is used at link time or not. I have been told that it
> is only used at run time, however if I set it and try to link some of
> the link errors seem to resolve themselves. Can some one please
> clarify whether or not LD_LIBRARY_PATH is used at both at link and run
> time.[/color]
LD_LIBRARY_PATH is used at runtime to specify non-standard paths for
dynamic shared libraries.
During link time, you can just give the full library path.
--
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: [url]http://www.fujitsu-siemens.com/imprint.html[/url]
-
Re: LD_LIBRARY_PATH
sandy wrote:[color=blue]
> On Oct 30, 5:53 am, 0infini...@gmail.com wrote:
> [color=green]
>>Hi ,
>>
>> I have been looking athttp://linuxmafia.com/faq/Admin/ld-lib-path.html
>>& the Linux man pages. I am just trying to work out if
>>LD_LIBRARY_PATH is used at link time or not. I have been told that it
>>is only used at run time, however if I set it and try to link some of
>>the link errors seem to resolve themselves. Can some one please
>>clarify whether or not LD_LIBRARY_PATH is used at both at link and run
>>time.
>>
>>Thx[/color]
>
>
> Hi....
> LD_LIBRARY_PATH is used only at run time. The working is as follows,
> whenever you set the environment variable LD_LIBRARY_PATH at the time
> of execution, this library gets loaded before the executable[/color]
ITYM LD_PRELOAD.
[color=blue]
> and its
> constructor is executed prior to the control going to the program
> start address.[/color]
"constructor" is an OO term.
With "ordinary" C-programs this would be the "_init"-function of the
shared library.
--
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: [url]http://www.fujitsu-siemens.com/imprint.html[/url]
-
Re: LD_LIBRARY_PATH
Rainer Weikusat <rweikusat@mssgmbh.com> writes:
[color=blue]
> sandy <sandeepksinha@gmail.com> writes:[color=green]
>> On Oct 30, 5:53 am, 0infini...@gmail.com wrote:[color=darkred]
>>> Hi ,
>>>
>>> I have been looking athttp://linuxmafia.com/faq/Admin/ld-lib-path.html
>>> & the Linux man pages. I am just trying to work out if
>>> LD_LIBRARY_PATH is used at link time or not. I have been told that it
>>> is only used at run time, however if I set it and try to link some of
>>> the link errors seem to resolve themselves. Can some one please
>>> clarify whether or not LD_LIBRARY_PATH is used at both at link and run
>>> time.
>>>
>>> Thx[/color]
>>
>> Hi....
>> LD_LIBRARY_PATH is used only at run time.[/color]
>
> This is wrong. RTFM ld.[/color]
It used to be true, and is the norm on non-GNU systems.
--
Måns Rullgård
[email]mans@mansr.com[/email]