J'ai essayé d'utiliser la bibliothèque Boost mais j'échoué, voir mon code:Comment puis-je utiliser la bibliothèque Boost :: regex.hpp en C++?
#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);
}
Quand j'ai essayé de le compiler je reçois ces messages:
/usr/include/boost/regex/v4 /regex_match.hpp:50: undefined reference to `boost :: re_detail :: perl_matcher < __gnu_cxx :: __ normal_iterator, std :: allocateur>>, std :: allocateur, std :: allocateur>>>>, boost :: regex_traits>
:: match() »
/usr/include/boost/regex/v4/basic_regex.hpp:425: référence non définie à ` boost :: basic_regex>
:: do_assign (char const *, char const *, unsigned int) »
/usr/include/boost/regex/v4/perl_matcher.hpp:366: référence non définie à `boost :: re_detail :: perl_matcher < __gnu_cxx :: __ normal_iterator, std :: allocateur>>, std :: allocateur, std :: allocateur>>>>, boost :: regex_traits>
:: construct_init (boost :: basic_regex>> const &, boost :: regex_constants :: _ match_flags) »
etc ...