-1

I've a native lib that is communication with sqlite3, it works fine within Android, so, I compiled it for iOS, compilation process completed smoothly, but at the time of exciting, i.e. once building the iOS app in Xcode, I got the below error:

symbol(s) not found for architecture x86_64

Undefined symbols for architecture x86_64: "_sqlite3_column_int64", referenced from: rusqlite::statement::Statement::value_ref::h1ef4d7e4ee859386 in libgreetings.a(rusqlite-39d80e8cd3d6a115.rusqlite.99wt63ts-cgu.3.rcgu.o) "_sqlite3_column_blob", referenced from: rusqlite::statement::Statement::value_ref::h1ef4d7e4ee859386 in libgreetings.a(rusqlite-39d80e8cd3d6a115.rusqlite.99wt63ts-cgu.3.rcgu.o) "_sqlite3_bind_int64", referenced from: rusqlite::statement::Statement::bind_parameter::hc14d4185381afdbf in ... ... ...

Even when I changed the iOS Development target as shown here and installed simulator iOS 10, and changed the Architectures to $(ARCHS_STANDARD_32_BIT) instead of $(ARCHS_STANDARD) as shown here I got the same error with:

ld: symbol(s) not found for architecture i386

Note: The lib is built using rust and rusqlite crate, the lib was called smoothly and executed very well before adding the sqlite part.

Peter Hall
  • 53,120
  • 14
  • 139
  • 204
Hasan A Yousef
  • 22,789
  • 24
  • 132
  • 203

1 Answers1

0

You should link against sqlite3 library first before you compile the app. follow the step:

  1. go to the target's "Build Phases" -> "Link Binary With Libraries" section.
  2. click add "+".
  3. search sqlite.
  4. select "libsqlite3.tbd", "tbd" is new extension of dylib file in iOS.
  5. click "Add" now your app successfully linked to sqlite lib, the error should have gone.
Jmb
  • 18,893
  • 2
  • 28
  • 55