Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// file: mymodule.cpp
- /// build: g++ -std=c++1y -fPIC -I/usr/include/python3.4 -lboost_python-py34 -lpython3.4m -shared -o "mymodule.so" mymodule.cpp
- #include <string>
- #include <iostream>
- #include <boost/python.hpp>
- #include "cppClass.h"
- using namespace boost::python;
- BOOST_PYTHON_MODULE(mymodule)
- {
- class_<cppClass>("cppClass", init<std::string>())
- .def("str", &cppClass::str)
- .def("print", &cppClass::print);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement