dll - load library from lisp script, working directory and path -
dll - load library from lisp script, working directory and path -
i need load library in lisp script.
the script "loader.lisp" , library "mylib.dll" in same folder "parent_dir".
if run script from within folder (current directory = "parent_dir") works fine:
(load "loader.lisp") ;ok lib loaded
but if current directory somewhere else, fails load (of course of study looks lib in wrong dir):
(load "parent_dir/loader.lisp") ;error, of course of study i'm in wrong working dir! ;error opening shared object "mylib.dll": ;dlopen(mylib.dll, 10): image not found.
the "loader.lisp" script contains (also) next code:
(setq lib_path "mylib.dll") (if (string= (software-type) "darwin") (setq lib_path "mylib_osx.lib")) #+allegro (load lib_path) #+sbcl (sb-alien:load-shared-object lib_path)
the question is: how can create loader.lisp script "working directory"-independent?
update: specify script ant interpreter executable not in same directory.
thank much!
i suggest next solutions:
use total path; keep library file in same directory programme (well, it's not bad idea); change parameter "start in" of program; add path library file os variable "path".it's rather question concept of os working directory lisp itself.
as far see solution involving "path" variable best one. can test method , tell if worked.
how set path in windows.
dll load lisp sbcl working-directory
Comments
Post a Comment