![](/img/trans.png)
[英]Microsoft C++ exception: std::regex_error at memory location
[英]Undefined symbol while using boost:regex_error in C++?
我正在使用boost庫進行正則表達式,我使用boost :: regex()函數來編譯正則表達式。 我必須捕獲此函數調用拋出的異常。 所以我在catch()中使用了boost:regex_error
。
但是使用此函數會出現以下錯誤:
undefined symbol: _ZTIN5boost11regex_errorE
上述錯誤的原因是什么?
你必須與boost_regex
鏈接。 在GCC上,將-lboost_regex
添加到鏈接器調用。 其他編譯器將有相同的選項。
$ c++filt _ZTIN5boost11regex_errorE
typeinfo for boost::regex_error
所以缺少typeinfo。 我認為您應該在啟用RTTI(運行時類型信息)的情況下編譯項目。
要么
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.