Lisp HUG Maillist Archive

unix dylib-path

unix dylib-path
Hello,

We have a problem with a MacOS X framework written in C accessed by LWM lisp code. The framework uses an Unix .dylib shared library with an install path /usr/local/lib. We would like to keep the dylib in a folder inside our project.
The framework can't be loaded when the dylib is not found at /usr/local/lib. We have found a way around this problem by invoking Lispworks from terminal after manually setting the environment variable DYLD_LIBRARY_PATH to point to the directory where we have stored the dylib. However, our attempts to set this environment variable in LWM before loading the framework have failed. We have tried several methods:


(setf (environment-variable "DYLD_LIBRARY_PATH")  "/Applications/LispWorks\ 4.4/PWGL-code/FLI-code/FLI-libs")

or:

(sys:open-pipe (format () "DYLD_LIBRARY_PATH=/Applications/LispWorks\ 4.4/PWGL-code/FLI-code/FLI-libs" ()))
(sys:open-pipe  (format () "export DYLD_LIBRARY_PATH" ()))


But it seems that the environment variable is not set correctly or that the system ignores it, as the DYLD lookup fails and the framework doesn't load.


Mikael

Re: unix dylib-path

Unable to parse email body. Email id is 3759

Re: unix dylib-path

On Apr 17, 2005, at 3:38 AM, Mikael Laurson wrote:

>
> We have a problem with a MacOS X framework written in C accessed by  
> LWM lisp code. The framework uses an Unix .dylib shared library with  
> an install path /usr/local/lib. We would like to keep the dylib in a  
> folder inside our project.
>  The framework can't be loaded when the dylib is not found at  
> /usr/local/lib. We have found a way around this problem by invoking  
> Lispworks from terminal after manually setting the environment  
> variable DYLD_LIBRARY_PATH to point to the directory where we have  
> stored the dylib. However, our attempts to set this environment  
> variable in LWM before loading the framework have failed. We have  
> tried several methods:
>
>
>

See

http://developer.apple.com/documentation/MacOSX/Conceptual/ 
BPRuntimeConfig/Concepts/EnvironmentVars.html

Also, if your library does not load because it has hardcoded paths, you  
can modify the path using the command line utility install_name_tool.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
  


Updated at: 2020-12-10 08:53 UTC