编译静态链接到icu的icu sqlite扩展 [英] Compiling the icu sqlite extension statically linked to icu

查看:33
本文介绍了编译静态链接到icu的icu sqlite扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编译 icu sqlite 扩展 静态链接到 icu.

这是我试过的,也许错误对你来说很明显.

<前>> cd icu/来源> ./runConfigureIcu Linux --enable-static --with-packaging-format=archive...> 制作> 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"未定义符号 utf8_countTrailBytes

文件

icu sqlite 扩展

从 sqlite.org 下载 icu.c

重症监护病房 4.2.1

从 icu-project.org 下载 ICU4C

我的要求

  • 在 Linux 上运行窗户
  • 我只需要分发一个文件:libSqliteIcu.so.

知道我还能尝试什么吗?

文档

解决方案

这个命令行在 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

注意库文件的顺序,以及使用 g++ 来确保引用 c++ 运行时,即使我们正在编译 C 文件.

注意.我使用了 icu-config --prefix=../icu/source --ldflags 的输出.

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

Files

icu sqlite extension

Download icu.c from sqlite.org

ICU 4.2.1

Download ICU4C from icu-project.org

My Requirements

  • Runs on Linux & Windows
  • Only one file that I have to distribute: libSqliteIcu.so.

Any idea what else I can try?

Documentation

解决方案

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.

这篇关于编译静态链接到icu的icu sqlite扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆