[C++-sig] Boost Python help

2024-05-11 Thread Robert Applin
Hi, I'm having problems exposing a C++ class to python using Boost::Python (v1.84). I have defined the following code: class TestClass { public: TestClass() {} }; void test(TestClass& self, std::string const &testStr) { std::cout << "BEFORE" <>("TestClass").def("test", &test); } I then r

Re: [C++-sig] Boost Python help

2024-05-11 Thread Ralf W. Grosse-Kunstleve
Quick guess: a binary incompatibility, e.g. how you compile your extension vs how the libboost_python you link against was built. Your code looks good to me. I'd try different compile and link options for building your extension. Alternatively, you could use cmake, e.g. this worked for me a few