zoukankan      html  css  js  c++  java
  • ubuntu14.04 boost 1.58.0 安裝

    1.首先下载安装包,然后解压, 切换目录

    wget -o boost_1_58_0.gar.gz http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.bz2/download
    tar xf boost_1_58_0.tar.gz
    cd boost_1_58_0
    

     2. 编译前安装必要的库

    sudo apt-get install mpi-default-dev # mpi related
    sudo apt-get install libicu-dev # regular expresion related
    sudo apt-get install python-dev # python dev related
    sudo apt-get install libbz2-dev 
    

     3. 编译安装boost

    tar xf boost_1_58_0.tar.gz
    cd boost_1_58_0/ ./bootstrap.sh ./b2 -a -sHAVE_ICU=1 # the parameter means that it support icu or unicode sudo ./b2 install

     4. 测试boost是否安装成功

        c++代码(testBoost.cpp)

     #include <iostream>
     #include <boost/timer.hpp>
     
     using namespace boost;
     
      int main()
      {
             timer t;
             std::cout << "max timespan:" << t.elapsed_max() / 3600 << "h" << std::endl;
             std::cout << "min timespan:" << t.elapsed_min() << "s" << std::endl;
     
             std::cout << "now itme elapsed:" << t.elapsed() << "s" << std::endl;
     
             return EXIT_SUCCESS;
     }
    

        编译

    g++ testBoost.cpp -lboost_system -lboost_filesystem -o testBoost
    ./testBoost
    

        运行结果

        max timespan:  ....

        min timespan:  ....

  • 相关阅读:
    一个页面从输入 URL 到页面加载显示完成,这个过程中都发生了什么?
    210902
    1-2
    1-1
    4
    3
    2
    1
    u编码
    windows java 安装版 控制面板
  • 原文地址:https://www.cnblogs.com/lvchaoshun/p/5956283.html
Copyright © 2011-2022 走看看