Opened 16 years ago

Closed 16 years ago

#828 closed Bugs (Accepted)

Problem compiling regex with icu support on solaris

Reported by: nobody Owned by: nobody
Milestone: Component: build
Version: None Severity:
Keywords: Cc:

Description

Hi,

I'm trying to compile boost 1.33.1 with icu support on Solaris, with SUNpro compiler. The file ico.cpp doesn't compile.

The compilation line is:
I define ICU_PATH, and eventually the command line:

% CC -c -O2 -mt -I../../../ -o sunpro/libboost_regex_mt/icu.o ../src/icu.cpp -DBOOST_HAS_ICU=1 -I$ICU_PATH/include

"../../..//boost/iterator/iterator_facade.hpp", line 838: Error: Could not find a match for boost::iterator_core_access::equal<boost::iterator_core_access::Facade1, boost::iterator_core_access::Facade2>(const boost::u32_to_u16_iterator<const int*, unsigned short>, const boost::u32_to_u16_iterator<const int*, unsigned short>, boost::is_convertible<boost::u32_to_u16_iterator<const int*, unsigned short>, boost::u32_to_u16_iterator<const int*, unsigned short>>).

It works with no problem with gcc (on Linux and on Solaris).

Thanks, Moddy.  ( moddyt@itemfield.com)



Change History (6)

comment:1 by John Maddock, 16 years ago

Logged In: YES 
user_id=14804
Originator: NO

Which sunpro version are you using?  The ICU support depends upon Boost.Iterator: these tests are currently passing with Sunpro-5.8, but I suspect issues with earlier Sunpro versions.

John.

comment:2 by sf-robot, 16 years ago

Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

comment:3 by nobody, 16 years ago

Logged In: NO 

I was using 5.5, so I moved to 5.8. I get different errors now:

% CC -V
CC: Sun C++ 5.8 Patch 121018-05 2006/08/30

% CC -c -O2 -I../../../ -I$ICU_PATH/include -DBOOST_HAS_ICU -o sunpro/libboost_regex/icu.o ../src/icu.cpp 

"../../..//boost/regex/v4/iterator_traits.hpp", line 34: Error: boost::re_detail::T is not a namespace or class name.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 34: Error: No parameters provided for template.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 35: Error: boost::re_detail::T is not a namespace or class name.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 35: Error: value_type is not defined.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 37: Error: boost::re_detail::T is not a namespace or class name.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 37: Error: difference_type is not defined.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 38: Error: boost::re_detail::T is not a namespace or class name.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 38: Error: pointer is not defined.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 39: Error: boost::re_detail::T is not a namespace or class name.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 39: Error: reference is not defined.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
"../../..//boost/regex/v4/iterator_traits.hpp", line 34: Error: Redefining boost::iterator_category<boost::Iterator> after use in boost::re_detail::regex_iterator_traits<const unsigned short*>.
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: While specializing "boost::re_detail::regex_iterator_traits<const unsigned short*>".
"../../..//boost/regex/v4/match_results.hpp", line 52:     Where: Specialized in boost::match_results<const unsigned short*, std::allocator<boost::sub_match<const unsigned short*>>>.
"../../..//boost/regex/icu.hpp", line 521:     Where: Specialized in non-template code.
11 Error(s) detected.

Thanks, Moddy.

comment:4 by John Maddock, 16 years ago

Logged In: YES 
user_id=14804
Originator: NO

OK, I think we're moving slowly forward :-)

Can you comment out the #if logic in:

#ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
template<>
struct regex_iterator_traits<unsigned short*> : pointer_iterator_traits<unsigned short>{};
template<>
struct regex_iterator_traits<const unsigned short*> : const_pointer_iterator_traits<unsigned short>{};
#endif

So that those specializations are *always* defined and see what happens?

I'm a little confused why that preprocessor branch is taken in the first place though: you might try building with the -library=stlport4 option to see if that improves things.  You may also find that you need to update Boost.Config to match the latest compiler: try following the configuration instructions here: http://www.boost.org/libs/config/config.htm#config_script and see if that improves things.

HTH, John.

comment:5 by nobody, 16 years ago

Logged In: NO 

I added these lines to icu.hpp, and it seems to solve the problem. I hope it was the right thing to do.

namespace boost{

namespace re_detail{

//added by Itemfield

template <>
struct regex_iterator_traits <UChar*> :
    pointer_iterator_traits<UChar>
{};

template <>
struct regex_iterator_traits <const UChar* > :
    const_pointer_iterator_traits<UChar>
{};

}

}

Thanks, Moddy.

comment:6 by John Maddock, 16 years ago

Status: assignedclosed
Logged In: YES 
user_id=14804
Originator: NO

Yes, that'll do the trick fine.

I look into fixing this in cvs.

John.
Note: See TracTickets for help on using tickets.