Boost.Regex with icu / unicode support

How to create Boost.Regex with icu / unicode support? My compiler is GCC and the IDE is Eclipse C ++. How to set up binaries using Eclipse? I tried to do this "bjam --sHAVE_ICU = 1 toolset = gcc". But that did not work. When I check if icu support is enabled with "bjam -has_icu", I still get "has icu builds: no".

+5
source share
3 answers

I create Boost against ICU using -sICU_PATH=<icuRoot> and -sICU_LINK="-L<icuLibDir>" .

I saw that Boost was unable to properly detect the ICU and it needed to fix the has_icu_test.cpp file (just return 0 from its main () function). This will work if you know that everything else is configured correctly.

+5
source

Hippos and Juggernauts

On some unix, this worked for me:

./b2 link=static,shared -sICU_PATH=/usr/local install

On the specified system, ICU headers are set in the /usr/local/include and ICU libraries in /usr/local/lib

To check if ICU headers are set (say, in /usr/local/include ), does the /usr/local/include/unicode/ directory exist and has many header files in it (e.g. symtable.h )

Note that when I followed the general advice from the network and passed -sICU_LINK='-L/usr/local/lib' to raise b2 , ICU detection (versions 1.62 and 1.63) failed.

In the previous answer, the user β€œNuSkooler” mentions that the has_icu_test.cpp plagiarism enhancement file is simply return 0; closes the test and increases the confidence that all this is genkhi with the ICU and continues it.

However, make sure that you also delete all ICU-related function calls and header files from this file, because it usually happens that has_icu_test.cpp cannot be compiled at first, or because ICU libraries or header files cannot be found with using internal functions.

With all this, I can confirm that Aegisub configure now passes the ICU test for me.

(and all this because John Hurt died sadly and I tried to put the subtitles in the Heaven Gate clip to give to a friend)

b.

0
source

I solved the problem by adding directly the path to include the ICU include directory in cflags when doing b2. For instance:

 ./b2 --with-regex cflags="-O0 -I\"$ICU_PATH/include\" 

You may also need to add the path to the ICU library and, in addition, the full paths to the linker libraries. Like that:

 export ICU_LINK="-L\"$ICU_PATH/lib\" -l\"$ICU_PATH/lib/libicudata.a\" -l\"$ICU_PATH/lib/libicui18n.a\" -l\"$ICU_PATH/lib/libicuuc.a\"" ./b2 --with-regex cflags="-O0 -I\"$ICU_PATH/include\" -sICU_LINK=$ICU_LINK \ 
0
source

All Articles