I want to compile the icu sqlite extension statically linked to icu.
This is what I've tried, maybe the mistake is obvious to you.
> cd icu/source
> ./runConfigureIcu Linux --enable-static --with-packaging-format=archive
...
> make
> cd ../../icu-sqlite
> gcc -o libSqliteIcu.so -shared icu.c -I../icu/source/common
-I../icu/source/i18n -L ../icu/source/lib -lsicuuc -lsicui18n -lsicudata
...
> sqlite3
> .load "libSqliteIcu.so"
Undefined symbol utf8_countTrailBytes
Download icu.c from sqlite.org
Download ICU4C from icu-project.org
libSqliteIcu.so.Any idea what else I can try?
This command line worked for me on Linux:
g++ -shared --language c -o libSqliteIcu.so icu.c -I../icu/source/common -I../icu/source/i18n -lpthread -lm -L../icu/source/lib -lsicui18n -lsicuuc -lsicudata -lpthread -lm
Notice the ordering of the library files, and the use of g++ to make sure the c++ runtime is referenced even though we're compiling a C file.
NB.
I used the output of icu-config --prefix=../icu/source --ldflags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With