在Windows下Qt使用Boost库简介:
- 新建一个空项目 boostQt 如下图所示,在 .pro 中添加 Boost库所在位置
我的路径位置: INCLUDEPATH += E:\books\boost\boost_1_77_0
添加测试代码,新建 main.cpp 如下所示:
#include <iostream>
#include <string>
#include <boost/lexical_cast.hpp>
#include <boost/scoped_ptr.hpp>
#include "Boost01_zhinengzhizhen.h"
using namespace std;
using namespace boost;
int main()
{
string s = "123.123";
float a = lexical_cast<float>(s);
cout << a << endl;
int b = 100;
string c = lexical_cast<string>(b);
cout << c << endl;
return 0;
}
编译运行即可