简体   繁体   中英

ndk-build with sqlite library error

I am creating an android application which is having native C code along with sqlite database. When I do a ndk-build from my jni folder,I am getting the following error.

undefined reference to `sqlite3_open'
peard.c:(.text+0x588): undefined reference to `sqlite3_exec'
peard.c:(.text+0x5f8): undefined reference to `sqlite3_exec'
peard.c:(.text+0x668): undefined reference to `sqlite3_exec'
peard.c:(.text+0x6d8): undefined reference to `sqlite3_prepare_v2'
peard.c:(.text+0x720): undefined reference to `sqlite3_column_count'
peard.c:(.text+0x734): undefined reference to `sqlite3_step'
peard.c:(.text+0x774): undefined reference to `sqlite3_column_text'
peard.c:(.text+0x78c): undefined reference to `sqlite3_column_name'
peard.c:(.text+0x800): undefined reference to `sqlite3_close'

I tried to run along with -lsqlite3 command also,but doesn't work. Thanks.

I solved the problem by adding sqlite3.c source file to my dependency files list in my Android.mk file.Special thanks to hirschhomsalz.

Narain.

您需要为android构建或安装sqlite3 (以及您项目依赖的所有其他非标准库),并使用-L-I参数构建项目以指向sqlite库和标头的arm版本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM