puedo crear .o archivo con g ++ -c test.cpp -std = C++ 0x, pero no me puedo enlace, tiene los siguientes errores:std :: regex_iterator con gcc
test.cpp:(.text+0xe5): undefined reference to `std::regex_iterator<char const*, char, std::regex_traits<char> >::regex_iterator(char const*, char const*, std::basic_regex<char, std::regex_traits<char> > const&, std::bitset<11u>)'
test.cpp:(.text+0xf1): undefined reference to `std::regex_iterator<char const*, char, std::regex_traits<char> >::regex_iterator()'
Código :
#include <regex>
#include <iostream>
#include <string.h>
typedef std::regex_iterator<const char *> Myiter;
int main()
{
const char *pat = "axayaz";
Myiter::regex_type rx("a");
Myiter next(pat, pat + strlen(pat), rx);
Myiter end;
return (0);
}
¿Qué versión de GCC? '' no se implementa y no incluye 4.6.2. Además, ¿por qué no usar 'std :: cregex_iterator' en su lugar? –
@Kerrek SB, 4.6.1 – Yola
¿Ha considerado usar las bibliotecas de refuerzo de expresiones regulares? Both boost :: regex y boost :: xpressive son completamente funcionales. – mark