JDJMSon wrote: > I was wondering if someone here could help me with a problem I'm having > building Python extensions with the Boost.Python library. > Basically, if I have a wrapper class with something like this: > > string TestFunc() > { > return "Hello World"; > } > > BOOST_PYTHON_MODULE(TestClass) > { > def("TestFunc",TestFunc); > } > > > It compiles and I can use it without a problem. However, when I try to > wrap a class with code like this: > > class TestClass > { > public: > TestClass() {}; > ~TestClass() {}; > string TestFunction(){return "Hello World";}; > }; > > BOOST_PYTHON_MODULE(TestClass) > { > class_<TestClass>("TestClass") > .def("TestFunction",&TestClass.TestFunction) > ; > } > >
Shouldn't that be: .def("TestFunction",&TestClass::TestFunction) > ; -- http://mail.python.org/mailman/listinfo/python-list