网页设计教学网站,家在宝安,国家pccm建设申报网站,石家庄logo标志设计http://blog.csdn.net/zgl_dm/article/details/8363843 linux平台下要编译安装除gcc和gcc-c之外#xff0c;还需要两个开发库#xff1a;bzip2-devel 和python-devel#xff0c;因此在安装前应该先保证这两个库已经安装#xff1a;#yum install gcc gcc-c bzip2 bzip2-deve…http://blog.csdn.net/zgl_dm/article/details/8363843 linux平台下要编译安装除gcc和gcc-c之外还需要两个开发库bzip2-devel 和python-devel因此在安装前应该先保证这两个库已经安装#yum install gcc gcc-c bzip2 bzip2-devel bzip2-libs python-devel -y然后是去官网下载源码包地址下载解压按照如下步骤#tar xvzf boost_1_50_0.tar.gz进入boost_1_50_0目录#cd boost_1_50_0然后是编译安装boost源码包中有配置脚本直接用就可以#sh ./bootstrap.shBuilding Boost.Build engine with toolset gcc... tools/build/v2/engine/bin.linuxx86_64/b2Detecting Python version... 2.6Detecting Python root... /usrUnicode/ICU support for Boost.Regex?... not found.Generating Boost.Build configuration in project-config.jam...Bootstrapping is done. To build, run:./b2To adjust configuration, edit project-config.jam.Further information:- Command line help:./b2 --help- Getting started guide: http://www.boost.org/more/getting_started/unix-variants.html- Boost.Build documentation:http://www.boost.org/boost-build2/doc/html/index.html接下来就是编译重点关注是否编译成功#./b2然后就是漫长的等待如果最后出现The Boost C Libraries were successfully built!The following directory should be added to compiler include paths:/home/gang/BAK/boost_1_50_0The following directory should be added to linker library paths:/home/gang/BAK/boost_1_50_0/stage/lib最后sudo ./b2 install --prefix/usr/local 1、 boost中大部分库是不用编译成动态或者静态链接库。2、 只有regex,thread等几个库比较麻烦一点.要编译。3、 如果用gcc编译器-l指定动态链接库的路径,还要指定头文件的路径。4、 或者链接的boost库放到.c或.cpp之后否则链接不能通过编译可以通过。如下所示g -lz -lpthread hh.c -lboost_filesystem -lboost_threadhttp://blog.163.com/yungang_z/blog/static/175153133201262445539767/