I'm try to integrate with others who give to me a shared library just only .so
files and the .h
files.
In mac os, the shared library should be .dylib
, But I don't how to set the environment or other way to solve the problems When I want to try to link with the shared library .so
files in mac.
I have a pyd/pyx
file I created manually.
for example, just I have a named hellopy.so
shared library.
the Distutils setup.py files:
from setuptools import setup, find_packages
from Cython.Build import cythonize
from Cython.Distutils import build_ext, Extension
other_dir=''
cython_header_dir =''
common_args = {
"include_dirs": [other_dir],
"library_dirs": [other_dir],
"language": "c++",
"cython_include_dirs": [cython_header_dir],
}
extensions = [
Extension(name="api.api",
sources=["api/api.pyx"],
extra_compile_args=[],
extra_link_args=[],
# todo fix libraries problems
libraries=["hellopy"],
**common_args),
setup(
include_package_data=True,
install_requires=["Cython>=0.22"],
setup_requires=["Cython>=0.22"],
packages=find_packages(),
cmdclass={"build_ext": build_ext},
ext_modules=cythonize(extensions),
exclude_package_data={"": ["*.cpp"]}
)
then try to compile the package.
python setup.py build_ext --inplace
ld: library not found for -lhellopy
clang: error: linker command failed with exit code 1 (use -v to see invocation)