Qt Creator+MinGW+boost特殊函数的使用示例

来源:互联网 发布:淘宝拍照 编辑:程序博客网 时间:2024/05/22 06:40

Qt Creator+MinGW+boost特殊函数的使用示例:

先编译和安装boost:

bootstrap.bat gcc .\b2 --toolset=gcc --prefix=E:\boost install
新建qt控制台项目,然后在*.pro文件中添加一行:
INCLUDEPATH += E:/boost/include/boost-1_53


 

测试acosf和贝赛尔函数,下面是main.cpp

#include <QCoreApplication>#include <boost/math/special_functions/acosh.hpp>#include <boost/math/special_functions/bessel.hpp>#include <iostream>using namespace boost::math;using namespace boost::math::detail;int main(int argc, char *argv[]){    QCoreApplication a(argc, argv);    std::cout<<"Test Boost:"<<std::endl;    std::cout<<acosh(2.5)<<std::endl;    std::cout<<bessel_i0(3.2)<<std::endl;    std::cout<<"Test Finished!"<<std::endl;    return a.exec();}

程序部分界面和运行结果为:


原创粉丝点击