Hello and thanks for answer.
> SetEnv works only in the program that's running, AFAIK, but may work for what you need?
It is exactly what I want, only for the program that is running.
But how do you do to use SetEnv ?
When using a TProcess, there is a SetEnv parameter, I did not know that it can be set for the main program. (or I miss something).
I ask this because if you use LoadLibrary(alibrary) (= dynamic loading) and if alibrary has dependencies, those dependencies must be in the defined library search path.
But that library search path needs root access if you want to paste something on it.
And I do not want to oblige the users to change something in their system or to have root permission to use my program.
Fre;D
________________________________
De : fpc-other <fpc-other-***@lists.freepascal.org> de la part de ***@z505.com <***@z505.com>
Envoyé : dimanche 12 mars 2017 22:19
À : Other FPC related discussions
Objet : Re: [fpc-other] How to set library search path ?
On 2017-03-12 14:15, Fred van Stappen wrote:
> Hello.
>
> Is it possible to set the search-path for library without to
> edit-change the config file ?
>
> For example, in Linux, you should edit .bash_profile and add:
>
> LD_LIBRARY_PATH=/usr/local/lib
> export LD_LIBRARY_PATH
> But is it possible to set that library path without to edit a file,
> only by command (via a TProcess) ?
>
> And if it is possible for Linux, how to do for Windows and FreeBSD and
> Mac OS (and other os are welcome).
>
> Thanks.
SetEnv works only in the program that's running, AFAIK, but may work for
what you need?
i.e. setenv is applied during the program lifetime, AFAIK, and then once
the program ends the env you set is no longer set any more. But, I'm
inexperienced with this - that's what I've read.
_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
fpc-other Info Page - Free Pascal<http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other>
lists.freepascal.org
NOTE ***** Due to incidents with spambots subscribing to the list and spamming it, your first message(s) may be delayed a bit before ...