dec1/Boost-for-Android

missing boost::asio::ssl::context::tlsv13_compatible

Closed this issue · 3 comments

the original error message is:

error: no member named 'tlsv13_compatible' in
      'boost::asio::ssl::context'

boost version: 1.68.0
comparison between pre-build products of Boost-for-Android and the official src code:
image

dec1 commented

Please try with Boost 1.72.0

Thanks for reply!
After I change Boost products version from 1.68.0 to 1.72.0 the above issue was solved but a new compile error occurred:

/Users/qzcsfchh/workspace/cpp_ws/Boost/ndk_21_boost_1.72.0/include/boost/asio/impl/executor.hpp:179:22: error: no member named
      'context' in 'std::__ndk1::reference_wrapper<boost::asio::io_context>'
    return executor_.context();
           ~~~~~~~~~ ^

Well, the context is that I have a C++ library depends on libboost_system.a which is build out of Boost V1.68.0 src code using the following commands:

    ./bootstrap.sh --with-libraries=system --with-toolset=clang
    ./b2 -j4 link=static cxxflags=-fPIC install --prefix=${boost_dir}

this compiles and works OK on my dev machine, but now I want to compile it for my android project.

ps. Boost V1.68.0 download link: 1.68.0/source

dec1 commented

Hello.
Im not sure exactly what your setup is. There seems to be some mixup on your side with boost versions and libraries.
You need to build boost on a dev (desktop) machine. You build it however for the "target" android (and copy the binaries with your app as necessary to the destination android phone to deploy your app).
You should be careful not to mix libraries and/or headers with different versions within a single application (or the libraries it in turn links to). Similarly do not mix libraries built for different targets(eg built for android and those for a desktop pc). Your explicitly calling "bootstrap.sh" is probably doing this. You should follow the instructions in my readme which references my own wrapper script that calls the more low level ones with the appropriate parameters.
I suggest you do a clean rebuild of everything following my readme as close as possible, and test the sample app I provide.
Be careful to use exclusively one boost version (I have tested with boost 1.72), and for one target (android)