如何建立使用常规的makefile升压依赖项目? [英] How to build a boost dependent project using regular makefiles?
问题描述
我工作的一个C ++项目,我们最近需要,包括在它的助推一小部分。升压部分确实是最小的(升压:: Python的),因此,在使用的bjam构建一切看起来矫枉过正(此外,大家对项目的工作感到满意之作,且没有堵塞knowloedge)。
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 everything looks like an overkill (besides, everyone working on the project feels comfortable with make, and has no knowloedge of jam).
我已经取得了相当一些测试,但我不能找到一种方法,包括在我的makefile的前身提到库,并构建成功的。
I made quite some tests already, but I cant find a way to include the formerly mentioned library in my makefile and make the build succesful.
您所有帮助深表一个preciated。 :)
All your help is deeply apreciated. :)
推荐答案
我有同样的问题,发现一个解决方案的教程。你1)需要将源代码编译成与 -fPIC
GCC选项的目标文件,以及2)编译此对象与库中的 - 共享
gcc的选项。当然,你也有反对Boost.Python库,(一般 -lboost_python
链接,但我的Debian系统是例如 -lboost_python-MT -py25
,我还补充 -I / usr / include目录/ pythyon25
)。在我的makefile我最终会做在一个命令这两个步骤。也见第这 presentation 的13。
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.
这篇关于如何建立使用常规的makefile升压依赖项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!