0
私のプログラムでは正規表現マッチングを使用する必要があります。私はそれのためにブーストライブラリを使用することにしましたが、コンパイルしようとすると奇妙なエラーが発生します。なにが問題ですか?? 私のコードがあります:Boost :: regex_matchは失敗します
TMP/cczkfDcy.o(.gnu.linkonce.t._ZN5boost11basic_regexIcNS_12regex_traitsIcEESaIcEED1Ev + 0x11を):
... #include <boost/regex.hpp> ... using namespace boost; ... map <string, double>::iterator container::find (string toFind) { iterator it; for (it=mainMap.begin(); it!=mainMap.end(); it++) { regex e ((*it).first); //this line works correct if (regex_match (toFind, e)) return it; } return it; } ...
エラーメッセージが投稿のために大きなであり、その始まりがあります:機能で
boost::basic_regex<char, boost::regex_traits<char>, std::allocator<char> >::~basic_regex()': : undefined reference to
ブースト:: reg_expression、 のstd ::アロケータ> ::〜reg_expression()」...
ありがとう))それは動作します! –
あなたは助けてくれる回答をアップホートして受け入れることができます - http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work :) –