Cross module dependencies in Boost Python

前端 未结 2 1921
你的背包
你的背包 2021-01-05 07:19

Suppose I have two boost python modules that are defined as follows. Module A:

class SomeClass {
public:
    SomeClass() {}
    ~SomeClass() {}
};
BOOST_PYTH         


        
2条回答
  •  自闭症患者
    2021-01-05 08:08

    I just recently started fiddling with Boost.Python and had the same problem.

    Check out section 6 of the following doc:

    http://www.boost.org/doc/libs/1_47_0/libs/python/doc/building.html

    6.1 - The Dynamic Binary

    The library contains a type conversion registry. Because one registry is shared among all extension modules, instances of a class exposed to Python in one dynamically-loaded extension module can be passed to functions exposed in another such module.

    I was using the static binary and got the same type of error you were getting. Once I changed to the dynamic binary, it compiled and ran fine.

提交回复
热议问题