编译和使用OpenSSL为Android上使用eclipse窗口 [英] Compiling and using OpenSSL for Android, on windows using eclipse

查看:905
本文介绍了编译和使用OpenSSL为Android上使用eclipse窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Windows上的Andr​​oid应用程序,使用eclipse。
我想使用OpenSSL我的Andr​​oid应用程序。它需要用C使用++通过NDK。
我试图从 https://github.com/fries/下载薯条'的OpenSSL源$ C ​​$ C Android的外部OpenSSL的并建立它。
我读了README.android文件,但我不明白这些指示是。
我是否需要下载的OpenSSL源$ C ​​$ C,除了薯条源$ C ​​$ C?
我曾试图把所有的文件薯条'到我的JNI Android项目的文件夹中。它抱怨找不到e_os.h和OpenSSL / crypto.h和其他类似的。
更具体地讲:

/Projects/Fatal/Android/OpenSSL/jni/ssl/s2_meth.c:59

 在文件由D包括:
D:/Projects/Fatal/Android/OpenSSL/jni/ssl/ssl_locl.h:124:18:错误:e_os.h:没有这样的文件或目录
D:/Projects/Fatal/Android/OpenSSL/jni/ssl/ssl_locl.h:126:28:错误:OpenSSL的/ buffer.h:没有这样的文件或目录
D:/Projects/Fatal/Android/OpenSSL/jni/ssl/ssl_locl.h:127:26:错误:OpenSSL的/ comp.h:没有这样的文件或目录

我不知道为什么它没有找到这些文件,我想对所有类型的路径加入到LOCAL_C_INCLUDES在所有类型的Andr​​oid.mk文件,但毫无效果。

我想知道如何建立OpenSSL的为Android。谢谢你。


解决方案

我意识到,薯条'GitHub的是只是一些修补的OpenSSL源

,它不是针对Android一个独立的OpenSSL。
因为它提供这是由NDK的NDK的构建需要Android.mk文件,这是必需的。你不想使用标准的gcc,因为你想建立它为Android它来构建。

I am developing an Android app on windows, using eclipse. I would like to use OpenSSL for my Android application. It needs to be used with C++ via NDK. I tried to download fries' OpenSSL source code from https://github.com/fries/android-external-openssl and build it. I read the README.android file, but I didn't understand what these instructions are for. Do I need to download the OpenSSL source code in addition to the fries source code? I have tried putting all the files from Fries' into my jni folder of the Android project. It complained about not finding e_os.h and openssl/crypto.h and others like that. More specifically:

In file included from D:/Projects/Fatal/Android/OpenSSL/jni/ssl/s2_meth.c:59:
D:/Projects/Fatal/Android/OpenSSL/jni/ssl/ssl_locl.h:124:18: error: e_os.h: No such file or directory
D:/Projects/Fatal/Android/OpenSSL/jni/ssl/ssl_locl.h:126:28: error: openssl/buffer.h: No such file or directory
D:/Projects/Fatal/Android/OpenSSL/jni/ssl/ssl_locl.h:127:26: error: openssl/comp.h: No such file or directory

I am not sure why it doesn't find those files, I tried to add all sort of paths into LOCAL_C_INCLUDES in all sort of Android.mk files, but nothing worked.

I would like to know how to build OpenSSL for Android. Thank you.

解决方案

I realized that the fries' github is just something to patch the source of OpenSSL, it's not a stand alone OpenSSL for android. It is required because it provide Android.mk files which are required by ndk-build of ndk. You don't want to build it using standard gcc because you want to build it for Android.

这篇关于编译和使用OpenSSL为Android上使用eclipse窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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