Je suis en train de compiler mon programme qui utilise regex sur linux. J'ai construit la bibliothèque boost dans le libs/regex/build en tapant make -fgcc.mak qui a créé un gcc répertoire contenant les quatre fichiers suivantslien pour booster regex dans gcc
boost_regex-gcc-1_35
boost_regex-gcc-d-1_35
libboost_regex-gcc-1_35.a
libboost_regex-gcc-d-1_35.a
Maintenant, je veux utiliser mon programme de regex qui est dans un répertoire arbitraire. I #include boost/regex.hpp
J'ai reçu l'erreur indiquant que regex.hpp est introuvable. Puis j'ai donné l'option -I dans le compilateur g ++. Je n'ai pas eu cette erreur. Mais je reçois l'erreur suivante
undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
Je googlé et trouvé que je dois relier en quelque sorte l'un des 4 ci-dessus bibliothèques à mon programme. Comment puis-je le faire. Lequel dois-je lier et pourquoi?