Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 无法使用boost::regex_C++_Regex_Boost - Fatal编程技术网

C++ 无法使用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

试图通过#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>::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库并与之链接的部分之一


请参阅:

编译项目时是否包含所需的库?编译器需要链接。如果不想链接到任何内容,请使用。