如何在/art/runtime/oat_file_assistant.cc中导入OpenSSL模块?

问题描述 投票:1回答:1

我想在Android系统的源代码中修改“ /art/runtime/oat_file_assistant.cc”以使用OpenSSL的SHA1功能。但是,在编译过程中,系统会提示找不到“ openssl / sha.h”文件。我对C ++不太了解,如何在“ /art/runtime/oat_file_assistant.cc”中正确使用OpenSSL?非常感谢。

这里是包含语句

#include <openssl/sha.h>
#incldue <openssl/pem.h>

致命错误:找不到“ openssl / sha.h”文件

c++ openssl include android-source
1个回答
0
投票

您需要将SSL库添加到static_libsshared_libslibart_defaultsart/runtime/Android.bp

示例:

cc_defaults {
    name: "libart_defaults",
    [...]
    shared: {
        shared_libs: [
            [ ... ]
            "libcrypto",
        ],
    }
}

Android构建工具(Soong)将负责在-I上添加gcc标志。

© www.soinside.com 2019 - 2024. All rights reserved.