Hello and thanks to Silvio, z505, Giuliano. > Did you try the TProcess.Environment? :-)
Of course but, afaik, it is not what I want. I will try to explain with a concrete example (but I have much other in same case). A project (uos) use c libraries. Mainly all that libraries are "run-alone" (only the called library is needed). But there are some libraries that have dependencies. For example libopusfile.so needs libopus.so. If the main program load such library with loadlibrary(/my/directory/libopusfile.so) ---> it will not work, even if libopus.so is in the same directory that libopusfile.so. And even if doing loadlibrary(/my/directory/opusfile.so) before loadlibrary(/my/directory/libopusfile.so ) it will nor work because there are no correspondance with the 2 loadlibrary() . And this is the challenge, how to load that dependeny if they are not in the lib-system directory. > Another way is passing before compiling: $ LD_LIBRARY_PATH=some-path make. Yes but for that the directory of dependencies must be known. In some case that dependencies come from elsewhere. > launch your application from a shell script, which does the work. Ok, but it is much more complicate for end-user. What I need is, like for TProcess.Environment.Textvariable, a environment variable for LoadLibrary(). In a previous topic : http://free-pascal-general.1045716.n5.nabble.com/uses-myunit-in-src-myunit-pas-td5727626.html Michael answered: >> So it is exactly what I propose: >> a TLoadLibrary with some features adapted for libraries that TProcess uses >> for executables (like environnement). >> Of course TLoadLibrary will have a LoadLibrary() and SafeLoadLibrary() but >> some properties too. >> What do you think ? > I don't see the point at all. > Why would you copy functionality that the OS provides out of the box ? > Michael. Huh, what are those functionality that the OS provides out of the box ? Fre;D
_______________________________________________ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other