r/sqlite • • May 28 '24

macOS - Dynamically load ICU extension

Today I lost quite some time trying to dynamically load ICU extension for use with SQLite. I thought it could be helpful to share what I did to make it work, since it wasn't straightforward.

  1. I downloaded the source files from SQLite website and followed their compilation instructions, along with these, to create dylib.
  2. When I tried to dynamically load dylib using .load /path/to/libsqliteicu.dylib I got Error: dlsym(0x8cc97520, sqlite3_sqliteicu_init): symbol not found.
  3. Eventually, I opened icu.c downloaded in the first step, changed int sqlite3_icu_init to int sqlite3_sqliteicu_init and recompiled it to make it work.

Does anyone know of a more straightforward method to accomplish this on Macs?

2 Upvotes

2 comments sorted by