`
isiqi
  • 浏览: 16028059 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

stlPort+boost的编译方法

阅读更多

这两个库,如果单独使用的话,都还好应付,如果放在一起使用,就比较麻烦,有些需要注意的点。

stlport:


stlport目录是主include目录,在vc项目包含文件夹设置中一定要把它提前(放在vs自带的前面)。
lib目录在vs项目库目录中包含
bin目录里的dll,请放在执行文件夹下,或干脆放在windows的system目录下,当然在环境变量PATH中添加路径也可以。


目录:
stlport -- 主要inlcude文件夹,只需包含这个即可

src - 非纯模板库的实现 source for iostreams implementation and other parts that aren't pure template code

lib - installation directory for STLport library (if you use STLport iostreams and/or locale only);it may contain more subdirs, if you use crosscompilation)



iostram等非纯模板代码库的编译:
To use STLport iostreams, locale and complex numbers, you have to build STLport library from sources in "build/lib" directory and link your programs with it.
从5.0版本开始,要使用stlPort,只能是使用stlPort提供的iostream或者干脆没有iostream。

具体参照:install

boost:

boost 其实同stlPort大致相同,基本上也是主要都是纯模板代码,但涉及到一些跟本地环境相关的,则需要特别编译这些库,例如:
* Boost.Filesystem
* Boost.IOStreams
* Boost.ProgramOptions
* Boost.Python (see the Boost.Python build documentation before building and installing it)
* Boost.Regex
* Boost.Serialization
* Boost.Signals
* Boost.System
* Boost.Thread
* Boost.Wave

编译方法:(由于使用了stlPort,编译格外麻烦!网上都是扯的,或者以前的版本,经过2个多小时无数次试验,最终成功)
1.修改user-config.jam,加一句
using stlport : 5.2.1 : E:\\svn\\ff\\3party\\STLport-5.2.1\\stlport : E:\\svn\\ff\\3party\\STLport-5.2.1\\lib ;
注意:inlude和lib之间的冒号,具体位置具体设定。
2.在vs命令行里,运行bootstrap.bat.
3.运行bjam stdlib=stlport --build-type=complete stage
--build-type=complete:build各种程序设置(mtd,mdd)下的boost版本。
stage: 代表编译输出目录
4. 最后,别忘了把boost目录加到vs的include文件夹中,把stage/lib加到包含库目录。

警告:
ps: 在使用boost时,由于其使用stlPort编译,需要在c/c++设置命令行设置中加上"/D_STLP_DEBUG"!

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics