zoukankan      html  css  js  c++  java
  • win7下编译boost库总结

    很多情况下都会用到boost库,之前可能通过boostpro直接下载编译好的二进制库,不过遗憾的是目前不再可用了。

    下面给出手动编译的过程说明,以版本1.44为例进行说明;

    第一步,执行bootstrap.bat,将会在同目录下生成bjam.exe.后面的编译将依赖于bjam.exe

    注:bjam.exe --show-libraries可以看到可以编译的库的名称,根据需要进行适当的挑选,也可以全部编译,不过会需要较长时间,建议选择编译自已需要的

    第二步,开始编译
    bjam.exe toolset=msvc-10.0 --build-type=complete address-model=64 --with-serialization --with-system --with-date_time --with-regex --with-filesystem --

    stagedir="E: ryoost_1_44_0lib64" stage

    bjam.exe toolset=msvc-10.0 --build-type=complete address-model=64 --with-serialization --with-system --with-date_time --with-regex --with-filesystem --

    prefix="E: ryoost_1_44_0lib64" install

    说明:以前只编译了serialization/system/date_time/regex/filesystem五个库

    注:
    stage/install: stage表示只生成库(dll和lib),生成的文件放到stage的子目录下,由参数--stagedir可指定路径;install还会生成包含头文件的include目录,生成的文件目

    录由参数--prefix指定

    address-model:生成32/64位的库,不使用时使用默认,生成32位的库文件,若要生成64位的库需显示指定address-model=64

    toolset:指定C++的编译器[ VS2008对应--toolset=msvc-9.0,vs2010对应--toolset=msvc-10.0 ],其它的可查找相关的参考说明

    --build-type: 编译类型,生成何种方式的库,发布版/调试版等,建议选择complete,生成调试版和发布版的,不过所需的时间稍长一些

    link:创建动态[  link=shared ]还是静态[link=static]的库.

    runtime-link:指定C++运行时库是静态[ runtime-link=static ]链接还是动态[ runtime-link=shared ]链接

    threading:单[  threading=single ]/多线程[  threading=multi ]编译。

    without/with:选择不编译/编译哪些库

    bjam常用的一些参数
    --build-dir=<builddir>    编译的临时文件会放在builddir里(这样比较好管理,编译完就可以把它删除了)
    --stagedir=<stagedir>    存放编译后库文件的路径,默认是stage
    --build-type=complete    编译所有版本,不然只会编译一小部分版本(确切地说是相当于:variant=release, threading=multi;link=shared|static;runtime-link=shared)
    variant=debug|release    决定编译什么版本(Debug or Release?)
    link=static|shared    决定使用静态库还是动态库。
    threading=single|multi    决定使用单线程还是多线程库。
    runtime-link=static|shared    决定是静态还是动态链接C/C++标准库。
    --with-<library>    只编译指定的库,如输入--with-regex就只编译regex库了。
    --show-libraries    显示需要编译的库名称

  • 相关阅读:
    一致性 hash 算法( consistent hashing )a
    wcf 推送 与 广播
    TFS 自动同步Server 端文件的批处理命令
    PHP面向对象
    H5缓存机制浅析-移动端Web加载性能优化【干货】
    100+ 超全的web开发工具和资源
    从零开始搭建论坛(一):Web服务器与Web框架
    JQuery:选择器
    JQuery:事件
    JQuery:DOM操作
  • 原文地址:https://www.cnblogs.com/frankz/p/3885046.html
Copyright © 2011-2022 走看看