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();
}
程序部分界面和运行结果为: