asg017 / sqlite-ulid

A SQLite extension for generating and working with ULIDs
Apache License 2.0
135 stars 8 forks source link

Error: undefined symbol: sqlite3_sqliteulid_init #7

Closed Kingsley-Eghianruwa closed 1 year ago

Kingsley-Eghianruwa commented 1 year ago

i compiled sqlite_ulid using cargo build -r --target aarch64-linux-android . i get the libsqlite_ulid.so file.i assume this file is a loadable sqlite extension but when i try to load the extension via .load ./libsqlite_ulid , i get the error Error: undefined symbol: sqlite3_sqliteulid_init. please how do i resolve this or how do i build a loadable extension for android

asg017 commented 1 year ago

Try renaming the libsqlite_ulid.so file to ulid.so and try again, with .load ./ulid.

Alternatively, try .load ./libsqlite_ulid sqlite3_ulid_init

This is happening because the entrypoint is named sqlite3_ulid_init, and sqlite tries to guess the entrypoint based on the name of the extension file. So it either needs to be called ulid.so (or ulid0.so), or you can instead pass in the entrypoint name manually.

Kingsley-Eghianruwa commented 1 year ago

Thank you. both suggestions worked.