(CMake):Windows环境下配置Boost

Windows环境下配置Boost

  • 编译器选择

  • CMakeLists文件,设置Boost头文件及库文件路径

  • 代码测试

#include <iostream>
#include <string>
#include <boost/regex.hpp>

int main(int, char**) {
    std::string str("acc133acc133");
    boost::regex e(R"(\d+)");
    boost::smatch m;
    if(boost::regex_search(str, m, e)){
        std::cout << m.str() << std::endl;
    }else{
        std::cerr << "erro\n";
    }
}
  • 运行结果

猜你喜欢

转载自blog.csdn.net/baidu_41388533/article/details/108904897
今日推荐