[fpc-pascal] [Linux] Accessing Shared Libraries in *Current* Binary Directory

Alan Krause alank at shermanloan.com
Thu Aug 21 16:18:49 CEST 2008


Tom,

In the bash shell, type in:

export LD_LIBRARY_PATH=.

This appends the current directory to the library search path, so if you cd
to the app's directory before executing it, you will be good to go. You
could also write a bash script to perform these steps automatically for you,
as I know some applications have done in the past.

Alan

On Wed, Aug 20, 2008 at 6:37 AM, T. Guilleminot <tom at guilleminot.org> wrote:

> Hi,
>
> For portability reason I would need to keep my shared libraries in the
> same directory as the binary which need to call them.
>
> As per http://courses.cs.vt.edu/~cs3304/FreePascal/doc/prog/node13.html<http://courses.cs.vt.edu/%7Ecs3304/FreePascal/doc/prog/node13.html>:
> "This program can be compiled without any additional command-switches, and
> should run just like that, provided the library is placed where the system
> can find it.
> For example, on LINUX, this is /usr/lib or any directory listed in the
> /etc/ld.so.conf file. On WINDOWS, this can be the program directory, the
> WINDOWS system
> directory, or any directoy mentioned in the PATH".
>
> So I would basically need the behaviour of Windows on Linux. Of course I
> would avoid to have to update ld.so.conf file.
> Is there any solution ?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20080821/8736f52e/attachment.html>


More information about the fpc-pascal mailing list