- Build Boost for Android
https://github.com/moritz-wundke/Boost-for-Android
set the NDK_ROOT
export NDK_ROOT=~/Android/Sdk/ndk/23.1.7779620
./build-android.sh $(NDK_ROOT) --boost=1.76.0
choose 1.74.0 or 1.76.0
- Build vsomeip
https://github.com/COVESA/vsomeip
set the CMAKEPATH
export CMAKEPATH=~/Android/Sdk/cmake/3.18.1/bin
mkdir build
cd build
ndk cmake
$CMAKEPATH/cmake .. -DBoost_INCLUDE_DIR=~/build-android-space/Boost-for-Android-master/build/out/arm64-v8a/include/boost-1_76 \ -DBoost_LIBRARY_DIR=/home/linxu/Workspace/build-android-space/Boost-for-Android-master/build/out/arm64-v8a/lib \ -DCMAKE_SYSTEM_NAME=Android \ -DNDKPATH=/home/linxu/Android/Sdk/ndk/23.1.7779620 \ -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \ -DANDROID_ABI="arm64-v8a" \ -DANDROID_NDK=$ANDROID_NDK \ -DANDROID_NATIVE_API_LEVEL=30 \ -DANDROID_PLATFORM=android-30 \ -DANDROID_STL=c++_shared \ -DCMAKE_BUILD_TYPE=${BUILDTYPE} \ -DANDROID_TOOLCHAIN=clang \ -DBOOST_ROOT=~/build-android-space/Boost-for-Android-master/build/out/arm64-v8a
make
modify the code
build-android-space/vsomeip-master/build$ make Scanning dependencies of target vsomeip3 [ 1%] Building CXX object CMakeFiles/vsomeip3.dir/implementation/endpoints/src/client_endpoint_impl.cpp.o [ 2%] Building CXX object CMakeFiles/vsomeip3.dir/implementation/endpoints/src/credentials.cpp.o [ 3%] Building CXX object CMakeFiles/vsomeip3.dir/implementation/endpoints/src/endpoint_definition.cpp.o [ 4%] Building CXX object CMakeFiles/vsomeip3.dir/implementation/endpoints/src/endpoint_impl.cpp.o In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/endpoints/src/endpoint_impl.cpp:8: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/ip/udp_ext.hpp:20: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/basic_datagram_socket_ext.hpp:21: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/basic_socket_ext.hpp:37: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_ext.hpp:35: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_base_ext.hpp:32: /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvmsg_op_ext.hpp:44:7: error: no matching constructor for initialization of 'boost::asio::detail::reactor_op_ext' : reactor_op_ext(&reactive_socket_recvmsg_op_base_ext::do_perform, complete_func), ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactor_op_ext.hpp:25:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided class reactor_op_ext ^ /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactor_op_ext.hpp:25:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactor_op_ext.hpp:32:5: note: candidate constructor not viable: requires 3 arguments, but 2 were provided reactor_op_ext(const boost::system::error_code& success_ec, ^ In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/endpoints/src/endpoint_impl.cpp:10: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/local/stream_protocol_ext.hpp:24: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/basic_socket_acceptor_ext.hpp:20: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/basic_socket_ext_local.hpp:37: In file included from /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_ext_local.hpp:33: /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvfrom_op_ext_local.hpp:40:7: error: no matching constructor for initialization of 'boost::asio::detail::reactor_op_ext_local' : reactor_op_ext_local(&reactive_socket_recvfrom_op_base_ext_local::do_perform, complete_func), ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactor_op_ext_local.hpp:25:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided class reactor_op_ext_local ^ /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactor_op_ext_local.hpp:25:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided /home/linxu/Workspace/build-android-space/vsomeip-master/implementation/helper/1.76/boost/asio/detail/reactor_op_ext_local.hpp:33:5: note: candidate constructor not viable: requires 3 arguments, but 2 were provided reactor_op_ext_local(const boost::system::error_code& success_ec, ^ 2 errors generated. make[2]: *** [CMakeFiles/vsomeip3.dir/build.make:121: CMakeFiles/vsomeip3.dir/implementation/endpoints/src/endpoint_impl.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:210: CMakeFiles/vsomeip3.dir/all] Error 2 make: *** [Makefile:149: all] Error 2
then make again
标签:NDK,space,implementation,vsomeip3,ext,build,Android,boost,android From: https://www.cnblogs.com/BruceWayne09/p/16716973.html