在C ++中使用boost:regex_error时未定义符号? [英] Undefined symbol while using boost:regex_error in C++?
本文介绍了在C ++中使用boost:regex_error时未定义符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将boost库用于正则表达式,我使用boost :: regex()函数来编译正则表达式.我必须捕获此函数调用引发的异常.所以我在catch()中使用了boost:regex_error
.
I'm using boost library for regular expression, I used boost::regex() function to compile the regular expression. I have to catch the exception thrown by this function call. So I used boost:regex_error
in catch().
但是使用此功能会产生以下错误:
But the use of this function gives following error:
undefined symbol: _ZTIN5boost11regex_errorE
上述错误的原因是什么?
What is the reason of above error?
推荐答案
您必须与boost_regex
链接.在GCC上,将-lboost_regex
添加到链接器调用中.其他编译器将具有等效的选项.
You have to link with boost_regex
. On GCC, add -lboost_regex
to your linker invocation. Other compilers will have equivalent options.
这篇关于在C ++中使用boost:regex_error时未定义符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文