Python - importing c++ module interfaces - cannot open shared object file -
i'm using folder structure this:
program program/app/app.py program/app/lib.so program/app/py_interfaces.so program/launcher.py
i have compiled python interfaces py_interaces.so
boost.python linking ./lib.so
, load library same folder interfaces. i'm importing interfaces in app.py
:
import py_interfaces
and if run app.py
works fine. need run launcher/py
, when that, error:
import error: ./lib.so: cannot open shared object file: no such file or directory.
i guess loads py_interfaces.so
fine, searches lib.so
in wrong folder: program
. possible force correctly? should link differently? dont' want change working directory (i need other files root program
directory)
are sure .
directory you're expecting? note .
means current working directory. launcher.py
not in same directory lib.so
, , that's you're seeing. way linked things, have work in app dir.
try using real paths when linking or path relative library, py_interfaces.so
. need fix in py_interfaces
itself.
edit:
here post referencing file relative executable/library path.
as mentioned n.m. n comments, correct way link relative path provide -rpath
$origin
when linking, making whole dependency thing more robust.
Comments
Post a Comment