C++ 无法使用boost::regex
试图通过#include'ing boost/regex.hpp然后创建此类对象来使用boost regex库时:C++ 无法使用boost::regex,c++,regex,boost,C++,Regex,Boost,试图通过#include'ing boost/regex.hpp然后创建此类对象来使用boost regex库时: boost::regex empty_line("^\\s*$"); 我在尝试编译时遇到以下错误: D:\...\boost\regex\v4\cpp_regex_traits.hpp:366: error: undefined reference to `boost::re_detail::cpp_regex_traits_char_layer<char>::i
boost::regex empty_line("^\\s*$");
我在尝试编译时遇到以下错误:
D:\...\boost\regex\v4\cpp_regex_traits.hpp:366: error: undefined reference to `boost::re_detail::cpp_regex_traits_char_layer<char>::init()'
D:\…\boost\regex\v4\cpp\u regex\u traits.hpp:366:错误:未定义对“boost::re\u detail::cpp\u regex\u traits\u char\u layer::init()的引用”
你知道怎么解决吗 Boost正则表达式是Boost中少数几个需要构建Boost库并与之链接的部分之一
请参阅:编译项目时是否包含所需的库?编译器需要链接。如果不想链接到任何内容,请使用。