(CMake): Configure Boost in Windows

Configure Boost in Windows

  • Compiler selection

  • CMakeLists file, set the Boost header file and library file path

  • Code test

#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";
    }
}
  • operation result

Guess you like

Origin blog.csdn.net/baidu_41388533/article/details/108904897