|
Boost Users : |
Subject: Re: [Boost-users] How to compile boost regex
From: manish4gupta (manish_at_[hidden])
Date: 2009-09-16 01:35:29
Still i am getting the following error.
regex.cpp: In function âvoid print_captures(const std::string&, const
std::string&)â:
regex.cpp:20: error: âconst struct
boost::sub_match<__gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >â
has no member named âsizeâ
regex.cpp:26: error: no match for âoperator[]â in
âwhat.boost::match_results<BidiIterator, Allocator>::operator[] [with
BidiIterator = __gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
Allocator =
std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
>](((int)i))[j]â
manish_at_user-desktop:~/Desktop$ g++ -ggdb -lboost_regex regex.cpp
regex.cpp: In function âvoid print_captures(const std::string&, const
std::string&)â:
regex.cpp:20: error: âconst struct
boost::sub_match<__gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >â
has no member named âsizeâ
regex.cpp:26: error: no match for âoperator[]â in
âwhat.boost::match_results<BidiIterator, Allocator>::operator[] [with
BidiIterator = __gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
Allocator =
std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
>](((int)i))[j]â
Steven Watanabe-4 wrote:
>
> AMDG
>
> manish4gupta wrote:
>> I am compiling the program using the following option g++ -ggdb
>> -lboost_regex
>> -o regex regex.cpp but it is giving error.
>>
>> <snip>
>> for(j = 0; j < what.captures(i).size(); ++j)
>>
>> <snip>
>>
>> Error message:
>> regex.cpp: In function âvoid print_captures(const std::string&, const
>> std::string&)â:
>> regex.cpp:20: error: âclass boost::smatchâ has no member named âcapturesâ
>> regex.cpp:26: error: âclass boost::smatchâ has no member named âcapturesâ
>>
>> How can i avoid that. Please help me.
>>
>>
>
> There is no function called captures. Use the subscript operator.
> what[i].size()
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
-- View this message in context: http://www.nabble.com/How-to-compile-boost-regex-tp25447212p25466226.html Sent from the Boost - Users mailing list archive at Nabble.com.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net