Android NDK 上的 sqlite3 库大小非常大
我将 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要从 .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.