A problem of Regex with ICU support

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

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.
Building the libraries has no effect on the headers - in any case no changes or #defines are necessary to *use* the headers, only when building the library.
I don't know how to pass the compiliation. Any idea?
I believe this is a bug in the example, which assumes that wchar_t is the same as UChar, I'll look into fixing this, Apologies for the confusion, John.
participants (2)
-
John Maddock
-
Qihong Wang