• Windows上编译Boost


    Boost做得很好,有自己的build系统,可以几乎一键式编译,这才是尼玛世界一流质量的良心开源库啊。

    将Boost 1.49.0解压到boost/boost_1_49_0里面,然后在boost目录底下创建以下bat脚本:

    @echo off

    cd boost_1_49_0

    :: build
    call bootstrap.bat
    bjam -j4 variant=release link=static runtime-link=static threading=multi --with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time --with-wave stage
    bjam -j4 variant=debug link=static runtime-link=static threading=multi --with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time --with-wave stage

    :: copy files
    mkdir ..elviclib
    mkdir ..elvicincludeoost
    xcopy /E /Y stagelib ..elviclib
    xcopy /E /Y boost ..elvicincludeoost

    cd..

    用Visual Studio 2008命令行运行这个脚本就会把32位的Debug和Release都生成到boost/elvic目录底下了。

    如果要编译64位的build请使用以下脚本:

    @echo off

    cd boost_1_49_0

    :: build
    call bootstrap.bat
    bjam -j4 architecture=x86 address-model=64 variant=release link=static runtime-link=static threading=multi --with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time stage --with-wave
    bjam -j4 architecture=x86 address-model=64 variant=debug link=static runtime-link=static threading=multi --with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time stage --with-wave

    :: copy files
    mkdir ..elvic64lib
    mkdir ..elvic64includeoost
    xcopy /E /Y stagelib ..elvic64lib
    xcopy /E /Y boost ..elvic64includeoost

    cd..

    -j4是指定使用4个进程来编译。

  • 相关阅读:
    面试总结
    CentOS 6.4 yum安装LAMP环境
    windows下XAMPP安装php_memcache扩展
    linux学习笔记
    本地虚拟机LNMP环境安装
    Linux下php安装memcache扩展
    linux下memcached安装以及启动
    阿里云服务器---centos编译安装ffmpeg
    [Yii2.0] 以Yii 2.0风格加载自定义类或命名空间 [配置使用Yii2 autoloader]
    Linux常用命令
  • 原文地址:https://www.cnblogs.com/len3d/p/3201027.html
Copyright © 2020-2023  润新知