posts - 27, comments - 14, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

编译boost库 thread

Posted on 2008-12-23 02:53 heeeey 阅读(1490) 评论(1)  编辑 收藏 引用
编译过程整理如下(vs2005 sp1):
1.下载boost库1.37.0。
    解压到目录D:\boost1370
2. 编译bjam(要编译boost,需要先编译出bjam,然后利用bjam来编译boost)
   1)修改D:\boost1370\tools\build\v2\user-config.jam
    添加
   
using msvc : 8.0 : : <compileflags>/wd4819 <compileflags>/D_CRT_SECURE_NO_DEPRECATE <compileflags>/D_SCL_SECURE_NO_DEPRECATE <compileflags>/D_SECURE_SCL=0 ;
using python : 2.6 ; 

   2) 运行cmd 定位到D:\boost1370\tools\jam\src目录下
       执行 build.bat 。会在该目录下生成bin.ntx86\bjam.
3. 编译boost库
   1)将bjam.exe拷贝到D:\boost1370下
    2)执行D:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat 设置编译环境。
   3)运行:
         bjam "-sTOOLS=vc-8_0" --with-thread install debug release 。只编译thread库(生成静态库和动态库(mt-gd))
         bjam "-sTOOLS=vc-8_0" --with-thread install debug release runtime-link=static  (生成 mt-sgd 的静态库(runtime-link-static))
         bjam "-sTOOLS=vc-8_0" --with-date_time install debug release。只编译date_time库
         bjam "-sTOOLS=vc-8_0" --with-date_time install debug release runtime-link=static

4. 编译结果
    在 C:\Boost\目录下生成include 和lib里面就是头文件和静态库。
   各种库的不同参考  http://weiwu83.javaeye.com/blog/98388

Feedback

# re: 编译boost库 thread  回复  更多评论   

2008-12-23 14:51 by jojo
好文

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理