Testing shared libraries compiled with FPC/Lazarus under Linux

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Testing shared libraries compiled with FPC/Lazarus under Linux

patspiper
Is it possible to test a shared library compiled with Lazarus/FPC under
Linux without copying that library to /usr/lib or fiddling with the OS
configuration to locate them?

Under Windows, it is enough to have the testing executable (host
application) in the same folder as the shared library. Is something of
the kind possible in Linux?

Stephano
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Testing shared libraries compiled with FPC/Lazarus under Linux

Tomas Hajny-2
On 9 Apr 12, at 0:42, patspiper wrote:

> Is it possible to test a shared library compiled with Lazarus/FPC under
> Linux without copying that library to /usr/lib or fiddling with the OS
> configuration to locate them?
>
> Under Windows, it is enough to have the testing executable (host
> application) in the same folder as the shared library. Is something of
> the kind possible in Linux?

I believe that LD_LIBRARY_PATH environment variable should do that
under Un*x platforms in general (i.e. including Linux).

Tomas

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Testing shared libraries compiled with FPC/Lazarus under Linux

patspiper
On 09/04/12 01:00, Tomas Hajny wrote:

> On 9 Apr 12, at 0:42, patspiper wrote:
>
>> Is it possible to test a shared library compiled with Lazarus/FPC under
>> Linux without copying that library to /usr/lib or fiddling with the OS
>> configuration to locate them?
>>
>> Under Windows, it is enough to have the testing executable (host
>> application) in the same folder as the shared library. Is something of
>> the kind possible in Linux?
> I believe that LD_LIBRARY_PATH environment variable should do that
> under Un*x platforms in general (i.e. including Linux).
Thanks!!

I will add that environment variable overrides can be entered in 'Run
Parameters' in Lazarus.

Stephano
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Testing shared libraries compiled with FPC/Lazarus under Linux

Alan Krause
In reply to this post by Tomas Hajny-2
Indeed. You can put the following in your .bashrc file:

export LD_LIBRARY_PAH=.

Alan

On Sun, Apr 8, 2012 at 3:00 PM, Tomas Hajny <[hidden email]> wrote:
On 9 Apr 12, at 0:42, patspiper wrote:

> Is it possible to test a shared library compiled with Lazarus/FPC under
> Linux without copying that library to /usr/lib or fiddling with the OS
> configuration to locate them?
>
> Under Windows, it is enough to have the testing executable (host
> application) in the same folder as the shared library. Is something of
> the kind possible in Linux?

I believe that LD_LIBRARY_PATH environment variable should do that
under Un*x platforms in general (i.e. including Linux).

Tomas

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Testing shared libraries compiled with FPC/Lazarus under Linux

patspiper
On 09/04/12 17:28, Alan Krause wrote:
Indeed. You can put the following in your .bashrc file:

export LD_LIBRARY_PAH=.
Not recommended security wise, especially that it is needed for testing only.

Stephano

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Testing shared libraries compiled with FPC/Lazarus under Linux

Jonas Maebe-2
In reply to this post by Alan Krause

On 09 Apr 2012, at 16:28, Alan Krause wrote:

> Indeed. You can put the following in your .bashrc file:
>
> export LD_LIBRARY_PAH=.

Make sure to never do that on a multi-user system, or you open yourself up to easy hijacking of your account (in the same way that adding "." to your PATH does).


Jonas_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal