跨多个 Android ndk 版本构建的库可以一起工作吗? [英] Can libraries built across multiple Android ndk versions work together?

查看:34
本文介绍了跨多个 Android ndk 版本构建的库可以一起工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个 Android C++ 项目,该项目要求我构建一个新的共享库并从现有代码调用该库.现有代码使用一个很旧的 ndk 版本.我正在考虑使用最新版本的 ndk 来构建我的共享库.我的想法是,只要 API 和 ABI 匹配,集成就可以正常工作.

I am working on an Android C++ project that requires me to build a new shared library and make a call into this library from existing code. Existing code uses a version of ndk that is quite old. I am thinking of using the latest version of ndk to build my shared library. My thought is, as long as the API and the ABI match, the integration should work fine.

想知道您是否发现这种方法有任何问题.

Wondering if you see any issues with this approach.

现有代码和新代码都使用 stl.我想我只是将我的代码与静态 stl 库链接起来,以避免任何运行时冲突.你认为这会奏效吗?问候.

Both, existing code and the new code, use stl. I am thinking I will simply link my code with static stl libraries to avoid any runtime conflicts. Do you think this would work? Regards.

推荐答案

他们通常会这样做,但这是一个完全未经测试的配置,并且确实会发生 ABI 损坏.

They usually do but it's a wholly untested configuration, and ABI breakages do happen.

如果这是一个选项,您应该始终匹配您的 NDK 版本.

If it's an option you should always match your NDK versions.

这篇关于跨多个 Android ndk 版本构建的库可以一起工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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