How to build a boost dependent project using regular makefiles?

前端 未结 4 1206
温柔的废话
温柔的废话 2021-01-12 05:37

I\'m working on a c++ project, and we recently needed to include a small part of boost in it. The boost part is really minimal (Boost::Python), thus, using bjam to build eve

4条回答
  •  孤城傲影
    2021-01-12 06:22

    I had the same problem and found a solution in this tutorial. You 1) need to compile the source into an object file with the -fPIC gcc option, and 2) compile this object into a library with the -shared gcc option. Of course you have also to link against the Boost.Python library (generally -lboost_python, however for my debian system it is for example -lboost_python-mt-py25, I have also to add -I/usr/include/pythyon25). In my makefile I end up doing those two steps in one command. See also p. 13 of this presentation.

提交回复
热议问题