python - Static linking with boost pyhthon -
i'm trying create boost python extension prefer statically link boost python libraries. otherwise need exact same version of boost installed on every machine use python module. i'm not using bjam though.
this works in linux (ubuntu) results in dynamic linking:
g++ -o python_example.o -c python_example.cpp -wall -fpic -i/usr/include/python2.7 g++ -shared -o python_example.so python_example.o -lpython2.7 -lboost_python -lboost_system
python_example.cpp basic example code:
#include <python.h> #include <boost/python/module.hpp> #include <boost/python/def.hpp> #include <boost/python.hpp> char const* greet() { return "hello, world"; } boost_python_module(python_example) { using namespace boost::python; def("greet", greet); }
lots of google results out there gave me lot of things try nothing quite worked.
Comments
Post a Comment