asio
asio copied to clipboard
Compile ASIO source code and output dynamic library, then Android 9.0 How to write Android.bp file
The contents of the Android.bp file are as follows:
libasio_srcs = [ "src/asio.cpp", "src/asio_ssl.cpp", ]
cc_defaults { name: "libasio_defaults",
rtti: true,
cppflags: [
"-std=c++11",
"-fexceptions",
"-Wall",
"-Werror",
"-fexceptions",
// "-DBOOST_THREAD_DONT_USE_CHRONO", // "-DBOOST_THREAD_POSIX", "-DBOOST_ASIO_HAS_STD_STRING_VIEW", ], }
cc_library_headers { name: "libasio_headers",
export_include_dirs: [
"include",
]
}
cc_library_shared { name: "libasio", vendor: false, defaults: ["libasio_defaults"],
header_libs: [
"libasio_headers",
],
srcs: libasio_srcs,
export_include_dirs: [".","include"],
export_header_lib_headers: [
"libasio_headers",
],
shared_libs: [
"liblog",
"libutils"
]
}
The following error occurs when compiling with mm -j16 command in AOSP / external / ASIO directory
In file included from external/asio/src/asio_ssl.cpp:11: external/asio/include/asio/ssl/impl/src.hpp:19:3: error: Do not compile Asio library source with ASIO_HEADER_ONLY defined
error Do not compile Asio library source with ASIO_HEADER_ONLY defined
^ In file included from external/asio/src/asio_ssl.cpp:11: In file included from external/asio/include/asio/ssl/impl/src.hpp:22: In file included from external/asio/include/asio/ssl/impl/context.ipp:24: In file included from external/asio/include/asio/ssl/context.hpp:23: In file included from external/asio/include/asio/ssl/context_base.hpp:19: external/asio/include/asio/ssl/detail/openssl_types.hpp:23:10: fatal error: 'openssl/conf.h' file not found #include <openssl/conf.h> ^~~~~~~~~~~~~~~~ 2 errors generated.
I want to ask for help. Thank you very much