Android NDK - 在使用ICU支持构建sqlite时出错

时间:2012-01-13 01:02:07

标签: android sqlite android-ndk icu

我正在尝试使用Android NDK上的ICU支持构建sqlite,在我的Android.mk中我有以下内容:

SQLITE3_INCLUDE_DIRS := -I/home_folder/dev/platform_external_icu4c/common -I/home_folder/dev/platform_external_icu4c/i18n

但是当我尝试编译时,我遇到了一堆undefined reference错误:


./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuNext':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125631: undefined reference to `ubrk_current_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125632: undefined reference to `ubrk_next_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125640: undefined reference to `u_isspace_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125640: undefined reference to `u_isspace_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125660: undefined reference to `u_strToUTF8_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125639: undefined reference to `utf8_nextCharSafeBody_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuClose':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125605: undefined reference to `ubrk_close_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuLikeCompare':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125075: undefined reference to `u_foldCase_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125076: undefined reference to `u_foldCase_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125052: undefined reference to `utf8_countTrailBytes_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuOpen':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125573: undefined reference to `u_foldCase_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125588: undefined reference to `ubrk_open_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125582: undefined reference to `utf8_nextCharSafeBody_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125595: undefined reference to `ubrk_first_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125570: undefined reference to `utf8_nextCharSafeBody_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuLikeFunc':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125126: undefined reference to `utf8_nextCharSafeBody_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuCollationDel':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125312: undefined reference to `ucol_close_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuFunctionError':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125152: undefined reference to `u_errorName_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuLoadCollation':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125371: undefined reference to `ucol_open_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125382: undefined reference to `ucol_close_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuCollationColl':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125328: undefined reference to `ucol_strcoll_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuCaseFunc16':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125293: undefined reference to `u_strToUpper_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125295: undefined reference to `u_strToLower_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuRegexpFunc':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125216: undefined reference to `uregex_setText_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125223: undefined reference to `uregex_matches_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125234: undefined reference to `uregex_setText_46'
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125204: undefined reference to `uregex_open_46'
./obj/local/armeabi/objs/sqlite3_jni/sqlite3secure.o: In function `icuRegexpDelete':
/home_folder/workspace/ndk-sqlite/jni/sqlite3.c:125163: undefined reference to `uregex_close_46'


1 个答案:

答案 0 :(得分:2)

你发布的节目包括目录,但是你是否在实际的ICU lib(.a)文件中链接,例如libicuuc.a?如果您有ICU的.mk或直接通过LOCAL_STATIC_LIBRARIES(或者更直接通过LOCAL_LDFLAGS),它们需要通过APP_MODULES在您的Application.mk中指定。

首选APP_MODULES方法。