You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im trying to bind a c++ library using pybind11. the compilation works well, but I had an error when I tried to import the .so file in a python file:
from project_pybind11 import *
I have this error :
from project_pybind11 import *
ImportError: generic_type: type "class_derived" referenced unknown base
type "NAMESPACE::class_derived"
Do you have any idea about the origin of this error ? or how I can get more details or information about this error. It can be an error related to the compilation process ?
namespace NAMESPACE
{
class class_derived: public class_base
{
public:
class_derived();
class_derived(const NAMESPACE::S_UINT32 classderivedId);
virtual void method1();
...
};
}
Pyclass_derived is a class that I implemented to take into account the virtual methods.
class Pyclass_derived: public NAMESPACE::class_derived{
public:
using NAMESPACE::class_derived::class_derived;
void method1() override { PYBIND11_OVERRIDE(void,
NAMESPACE::class_derived, method1); }
};
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
Im trying to bind a c++ library using pybind11. the compilation works well, but I had an error when I tried to import the .so file in a python file:
from project_pybind11 import *
I have this error :
Do you have any idea about the origin of this error ? or how I can get more details or information about this error. It can be an error related to the compilation process ?
I bind my class on this way :
my class .cpp is :
Beta Was this translation helpful? Give feedback.
All reactions