Include ICU in Android NDK Project

后端 未结 1 1373
囚心锁ツ
囚心锁ツ 2021-01-05 22:50

I built a library in C++ that I want to include in my Android application using the NDK. However, my library needs to use ICU4C. I have been trying to compile ICU for Androi

相关标签:
1条回答
  • 2021-01-05 23:35

    You can build ICU as Android static library by specifying these flags in your Android.mk

    LOCAL_CFLAGS := -DANDROID -fdata-sections -ffunction-sections
    LOCAL_CPPFLAGS := -DANDROID -frtti -fno-exceptions -fdata-sections -ffunction-sections
    

    If you use Android NDK without exceptions you will need to hack the missing cxa_bad_typeid()

    extern "C" std::type_info const& __cxa_bad_typeid()
    {
       // just return something
       return typeid(void*);
    }
    
    0 讨论(0)
提交回复
热议问题