Windows下QT程序中调用boost库

今天领导让我自学怎么在QT下使用boost库,至于boost库是什么,你可以搜一下。

   先从boost官网下载了boost(www.boost.org),安装在D盘。

   main.cpp中写入代码:

#include<QApplication>

#include <QDebug>
#include <boost/timer.hpp>

using namespace boost;
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    timer t;
    qDebug() << "max timespan:" << t.elapsed_max()/3600 ;
    qDebug() << "min timespan:" << t.elapsed_min();
    qDebug() << "now time elapsed:" << t.elapsed_min();

    return a.exec();
}

 

 

   接着在.pro文件中加入:INCLUDEPATH+= D:\boost_1_52_0

   OK!编译通过

posted @ 2016-03-15 08:21  crazy_machine  阅读(3532)  评论(0编辑  收藏  举报