Boost ライブラリを使用しようとしましたが、失敗しました。コードを参照してください。
#include "listy.h"
#include <boost/regex.hpp>
using namespace boost;
ListyCheck::ListyCheck() {
}
ListyCheck::~ListyCheck() {
}
bool ListyCheck::isValidItem(std::string &__item) {
regex e("(\\d{4}[- ]){3}\\d{4}");
return regex_match(__item, e);
}
コンパイルしようとすると、次のメッセージが表示されます。
/usr/include/boost/regex/v4/regex_match.hpp:50: `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator への未定義参照> > > >、boost::regex_traits >
::マッチ()'
/usr/include/boost/regex/v4/basic_regex.hpp:425: `boost::basic_regex への未定義の参照 >
::do_assign(char const*, char const*, unsigned int)'
/usr/include/boost/regex/v4/perl_matcher.hpp:366: `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator への未定義参照> > > >、boost::regex_traits >
::construct_init(boost::basic_regex > > const&, boost::regex_constants::_match_flags)'
等...