akaltar
akaltar

Reputation: 1097

Python .pyd equivalent on linux

I have some c++ code that is working as a python module using boost. It is actually a plugin of another c++ python module.

On windows, I have to link against a libavg.pyd file of this library.

On linux I tried linking against libavg.so, but when doing that, dlopen fails with undefined references to functions that should be defined in libavg.pyd.

What is the equivalent of linking to a .pyd file on linux?

Upvotes: 4

Views: 6845

Answers (1)

Artem Selivanov
Artem Selivanov

Reputation: 1957

On linux .pyd equivalent is .so files.

I'm not know about Boost::Python specifics, but you can try to use script like this:

from distutils.core import setup, Extension

module = Extension('ModuleName', sources=['yourmodule.cpp'], language="c++")

setup(name="ModuleName",
      version='1.0',
      description='My package',
      ext_modules=[module])

And after this just import your built module with .so-extension.

Upvotes: 3

Related Questions