Boost logo

Boost :

Subject: [boost] A problem of Regex with ICU support
From: Qihong Wang (qihongwang_at_[hidden])
Date: 2009-03-24 17:13:08


Hi,

I build my regex with icu support on Linux machine as follows
./bjam --prefix=/home/qhwang/mylibs/boost/ --with-regex
--build-dir=/tmp/boost_build/ --build-type=complete -sHAVE_ICU=1
-sICU_PATH=/home/qhwang/mylibs/icu/ install
The warning message from bjam shows icu is enabled.
I checked regex libraies were built. They are dependend on icu library. So I
believed HAVE_ICU
took effect. But look at the regex head files created, #define
BOOST_HAS_ICU is comment. Sounds
like icu is not enabled in head files.

I compiled icu_example from boost.regex source code mannually, with the
BOOST_HAS_ICU enable.

g++ -L/home/qhwang/mylibs/boost/lib/ -L/home/qhwang/mylibs/icu/lib/
-I/home/qhwang/mylibs/boost/include/boost-1_38
-I/home/qhwang/mylibs/icu/include -DBOOST_HAS_ICU -lboost_regex-gcc41-mt
-licudata -licuuc -licui18n -o icu_example icu_example.cpp
The compiler reported error when compile
  UnicodeString text = L"Some where in \x0391\x039D\x0395\x0398\x0391 2004";
 and
  assert(greek == L"\x0391\x039D\x0395\x0398\x0391 2004");
The error messages are:

 In function âint main()â:
icu_example.cpp:155: error: conversion from âconst wchar_t [25]â to
âicu_4_0::UnicodeStringâ is ambiguous
/home/qhwang/mylibs/icu/include/unicode/unistr.h:2695: note: candidates are:
icu_4_0::UnicodeString::UnicodeString(UChar32) <near match>
/home/qhwang/mylibs/icu/include/unicode/unistr.h:2688: note:
icu_4_0::UnicodeString::UnicodeString(UChar) <near match>
icu_example.cpp:157: error: conversion from âconst wchar_t [11]â to âconst
icu_4_0::UnicodeStringâ is ambiguous
I don't know how to pass the compiliation. Any idea?

Thanks,

Qihong


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk