Android NDK 上的 sqlite3 库大小非常大

发布于 2025-01-03 19:06:23 字数 244 浏览 3 评论 0原文

我将 sqlite3 合并编译到 Android NDK 中,并且可以从我的 C++ 代码中使用它。然而,libsqlite3.a 是 2.6MB。这个链接表示,对于具有 -O2 的典型 Linux/GCC 系统,库大小应约为 500KB。我使用NDK r6b来构建,并没有为编译器设置优化级别,但默认为-O2。知道为什么我的图书馆这么大吗?

I compiled the sqlite3 amalgamation into Android NDK, and I'm able to use it from my C++ code. However, libsqlite3.a is 2.6MB. This link says the library size should be around 500KB for typical Linux/GCC systems with -O2. I'm using NDK r6b to build, and didn't set an optimization level for the compiler, but the default is -O2. Any idea why my library is so large?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

渔村楼浪 2025-01-10 19:06:23

不要从 .a 文件测量库大小。测量链接大小(来自 .so 文件)。

尝试剥离 .a 库文件,也许它包含调试符号。

Don't measure library size from .a file. Measure linked size (from .so file).

Try stripping the .a library file, maybe it includes debugging symbols.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文