我写了一个这样的类头文件,所有步骤都遵循这个页面cppyy
class MyClass {
public:
MyClass(int i = -99) : m_myint(i) {}
int GetMyInt() { return m_myint; }
void SetMyInt(int i) { m_myint = i; }
public:
int m_myint;
};
然后编译它
$ genreflex MyClass.h
$ g++ -fPIC -rdynamic -O2 -shared -I$REFLEXHOME/include MyClass_rflx.cpp -o libMyClassDict.so -L$REFLEXHOME/lib -lReflex
加载到 pypy-c
$ pypy-c
>>>> import cppyy
>>>> cppyy.load_reflection_info("libMyClassDict.so")
然后我得到了这个错误
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: libMyClassDict.so: cannot open shared object file: No such file or directory
有谁遇到过这个问题,请帮帮我!