如何将已编译的C库添加到Android? [英] How to add already compiled C library to Android?

查看:150
本文介绍了如何将已编译的C库添加到Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编译了库(适用于linux(.a)和Windows(.dll)).我需要将其中一个库(我想对于Android我必须使用.a)库导入到我的android项目中.

I have already compiled libraries (for linux(.a) and windows(.dll)). I need to import one of those (I guess for Android I will have to use .a) libraries into my android project.

因此,我已经阅读了有关NDK的一些教程,但这是一个问题-我是否需要具有源文件才能将库添加到android,或者可以添加已经编译的文件?

So I have read some tutorials on NDK, but here is a question - do I need to have source files in order to add libraries to android or I can add already compiled?

推荐答案

您必须使用Android NDK重新编译该库. ARM体系结构与x86体系结构完全不同.在Linux和Windows上,系统调用是不同的.只是做不到.

You have to use the Android NDK to recompile the library. The ARM architecture is completely different from the x86 architecture. The system calls are different on Linux and Windows. It just cannot be done.

这篇关于如何将已编译的C库添加到Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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