Binding error: undefined link to icu_50 :: UnicodeString :: UnicodeString ()

I am trying to compile my project where some members of the class declared:

icu::UnicodeString label; icu::UnicodeString tags; icu::UnicodeString domain; icu::UnicodeString data; 

After turning on (yes, it is found)

 #include <unicode/unistr.h> 

In my CMakeLists.txt, it searches, finds, and associates with: icuuc icudata (libicuuc, libicudata), as the output shows before throwing errors:

-o icarus -rdynamic -lPocoNet -lPocoUtil -lPocoXML -licuuc -licudata p>

I built and installed icu4c 50.1.2 from the source and installed it under / usr / local / * cmake it finds the libraries correctly, since my errors are related to the binding phase:

undefined reference to icu_50::UnicodeString::UnicodeString()' undefined reference to icu_50 :: UnicodeString :: ~ UnicodeString ()'

I am using gcc-4.7.2 with -std = C ++ 0x included in Debian Wheezy. The exact same code compiled with gcc-4.3.2 with the same flags on Debian Squeeze last night!

I canโ€™t for my life find out what Iโ€™m doing wrong! Please, help!

+4
source share
1 answer

It seems that it was my mistake when creating the ICU4C. I am leaving a brief explanation as I have seen a lot of Google posts on this, but no answers. If you carefully read the documentation when setting up icu, it says that you have to do certain things:

1) Define namespace usage to false:

  # ifndef U_USING_ICU_NAMESPACE -# define U_USING_ICU_NAMESPACE 1 + // Set to 0 to force namespace declarations in ICU usage. +# define U_USING_ICU_NAMESPACE 0 

2) When building on linux, I went for a non-shared, static library:

 runConfigureICU Linux --enable-static --disable-shared 

3) This is the important part that caused my errors:

By default, ICU library entry point names have the ICU version suffix. Turn this off for system level installation to enable ICU updates without breaking applications. For instance:

 runConfigureICU Linux --disable-renaming 

Public header files from this configuration must be installed to enable applications and obtain the correct entry point names.

I did this on Squeeze, but not on Wheezy, thereby causing all binding errors on a system-wide installation. Lesson learned, hope this helps someone else.

+5
source

All Articles