c++ - Where Should Shared Object Files Be Placed? -


i venturing land of creating c/c++ bindings python using pybindgen. i've followed steps outlined under "building ( gcc instructions )" create bindings sample files:

http://packages.python.org/pybindgen/tutorial.html#a-simple-example

running make produces .so file. if understand how .so files work, should able import classes in shared object python. however, i'm not sure place file , how let python know is. additionally, original c/c++ source files need accompany .so file?

so far i've tried placing file in /usr/local/lib , adding path dyld_library_path .bash_profile. when try import module within python interpeter error thrown stating module can not found.

so, question is: needs done generated .so file in order used python program?

python looks .so modules in same directories searches python ones. have install normal python module either somewhere on python's sys.path default (/usr/share/python/site-lib or that—it'd distribution-dependent) or add directory pythonpath environment variable.

it's python that's loading module using dlopen, not dynamic linker, ld_library_path (note, there no dy) won't you.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -