Coder Social home page Coder Social logo

dec1 / boost-for-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moritz-wundke/boost-for-android

159.0 17.0 42.0 48.57 MB

Android port of Boost C++ Libraries

License: MIT License

Shell 67.73% Java 17.67% C++ 7.75% CMake 6.84%
android boost cpp jni mobile native

boost-for-android's Introduction

Build and/or simply download the Boost C++ Libraries for the Android platform, with Google's Ndk.

The Boost C++ Libraries, are possibly the most popular and generally useful c++ libraries. It would be nice to be able to use them when developing (native c++ or hybrid java/c++ with Google's Ndk) apps and/or libraries for Android devices. The Boost libraries are written to be cross platform, and are available in source code format. However, building the libraries for a given target platform like Android can be very difficult and time consuming. (In particular, building arm64_v8a shared libraries that an application can actually load). This project aims to lower the barrier by offering a simple customizable build script you can use to build Boost for Android (abstracting away all the details of the underlying custom boost build system, and target architecture differences), and even providing standard prebuilt binaries to get you started fast.

Tested with Boost 1.83.0 and Google's Ndk 26b (LTS).

You can build directly on a Linux or MacOS machine, or indirectly on any of Linux, Windows, MacOS via docker (or of course virtual machines and wsl). No matter what OS you use to build with, the resulting binaries can then be copied to any other, and used from then on as if you had built them there to start with (theyre cross compiled for android and have no memory of where they were built).

Creates binaries for multiple abis (armeabi-v7a, arm64-v8a, x86, x86_64).

Tested on a development machine running Ubuntu 20.04 and MacOS 11.6.5

Prebuilt

You can just download a current set of standard prebuilt binaries here if you don't need to customize the build, or don't have access to a unix-like development machine.

Build Yourself

Build using Docker

The easiest and most flexible way to build is to use docker. This way you need not need to install any build tools or other prerequisites, and can use any host operating system you wish that has docker installed.

See docker_readme for instructions.

Build directly on your Linux or MacOS machine

  • For prerequisites see Dockerflile (even though the remaining instructions below don't use docker)
  • Download the boost source and extract to a directory of the form ..../major.minor.patch eg /home/declan/Documents/zone/mid/lib/boost/1.83.0 Note: After the extarction ..../boost/1.83.0 should then be the direct parent dir of "bootstrap.sh", "boost-build.jam" etc
> ls /home/declan/Documents/zone/mid/lib/boost/1.83.0
boost  boost-build.jam  boostcpp.jam  boost.css  boost.png  ....
  • Clone this repo:
> git clone https://github.com/dec1/Boost-for-Android.git ./boost_for_android
  • Modify the paths (where the ndk is) and variables (which abis you want to build for) in do.sh, and execute it. If the build succeeds then the boost binaries should then be available in the dir boost_for_android/build Note: If you download the ndk directly do not extract it with Ark. It produces a corrupt extraction, that results in strange compiler errors. (use unzip instead)
> cd boost_for_android
> ./do.sh
  • Note: If for some reason the build fails you may want to manually clear the /tmp/ndk-your_username dir (which gets cleared automatically after a successful build).

Test App

Also included is a test app which can be opened by Android Studio. If you build and run this app it should show the date and time as calculated by boost chrono (indicating that you have built, linked to and called the boost library correctly), as well as the ndk version used to build the boost library. To use the test app make sure to adjust the values in the local.properties file.

Note: The test app uses CMake for Android

Header-only Boost Libraries

Many of the boost libraries (eg. algorithm) can be used as "header only" ie do not require compilation . So you may get away with not building boost if you only want to use these. To see which of the libraries do require building you can switch to the dir where you extracted the boost download and call:

> ./bootstrap.sh --show-libraries 

which for example with boost 1.83.0 produces the output:

The following Boost libraries have portions that require a separate build
and installation step. Any library not listed here can be used by including
the headers only.

The Boost libraries requiring separate building and installation are:
    - atomic
    - chrono
    - container
    - context
    - contract
    - coroutine
    - date_time
    - exception
    - fiber
    - filesystem
    - graph
    - graph_parallel
    - headers
    - iostreams
    - json
    - locale
    - log
    - math
    - mpi
    - nowide
    - program_options
    - python
    - random
    - regex
    - serialization
    - stacktrace
    - system
    - test
    - thread
    - timer
    - type_erasure
    - url
    - wave

Crystax

Crystax is an alternative to Google's Ndk. It ships with prebuilt boost binaries, and dedicated build scripts. These binaries will however not work with Goolge's Ndk. If for some reason you can't or don't want to use Crystax then you can't use their boost binaries or build scripts, which is why this project exists.

Contributions

  • Many thanks to crystax for their version of build-boost.sh which I adapted to make it work with the google ndk.

boost-for-android's People

Contributors

bavery22 avatar dec1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boost-for-android's Issues

Compiling Boost.Locale

Hi, great work :)
Couldn't find the locale library (no libboost_log.so in the build directory), nor could I find a list to add the this library to.

Can you please help me compile the boost locale library as well?

Script fails at ./bootstrap.sh --with-toolset=cc

I am trying to build boost_1_69 using latest ndk(20.0.5594570), which is the one that my Android Studio uses. My build stops early with the following message. I was also unable to find 'bootstrap.log' that is referred to the message.

HOST_OS=linux
HOST_EXE=
HOST_ARCH=x86_64
HOST_TAG=linux-x86_64
HOST_NUM_CPUS=4
BUILD_NUM_CPUS=8
Checking whether the compiler generates 32-bit binaries...gcc -c -o /tmp/ndk-fotis/tmp/tests/test-15553.o /tmp/ndk-fotis/tmp/tests/test-15553.c
no
Building Boost boost_1_69_0 armeabi-v7a libraries (C++ stdlib: llvm)
Copying directory:
from /home/fotis/Android/boost_1_69_0/boost_1_69_0
to /tmp/ndk-fotis/tmp/build-15553/build-boost/armeabi-v7a/llvm/src
COMMAND: mkdir /tmp/ndk-fotis/tmp/build-15553/build-boost/armeabi-v7a/llvm/host-bin
COMMAND: ./bootstrap.sh --with-toolset=cc
Building Boost.Build engine with toolset cc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details
ERROR: Could not bootstrap Boost build
PS : Do I need all of armeabi-v7a, arm64-v8a, x86, x86_64?

Build debug binaries

It would be useful if it is possible to build debug binaries of boost instead of only release.
Preferable by a command line flag that lets you choose between debug/release and defaults to release.

If there is no flag, is it possible to manually make a debug build by some small modifications of the script? Any guidance would be appreciated.

abi x86 and arm64-v8a failed to build (link) in the example app

In build.gradle: If I set
abiFilters 'armeabi-v7a'

the example app built.
If I set it to
abiFilters 'x86' or
abiFilters 'arm64-v8a'

The build fails with a line similar to
undefined reference to 'boost::system::detail::system_category_instance'.
I was doing this so I could run the sample on the Android emulator.

This issue:
boostorg/system#26 (comment)
indicates that it is a language feature problem. I rebuilt boost with
cxxstd=14
added to the run ./b2 call in build-boost.sh. This allowed it to link for all 4 abis.

It didn't look like you were keeping a user-config.jam that I could have put the change into. Maybe this should become the default in the shell script?

I can do a PR if you want it as a change to the script.

Linkage problems with only the armeabi-v7a architecture

After downloading the prebuilt Boost 1.69.0 using NDK 19c, I've tried integrating it into our product using NDK 19c. The only architecture that fails to link against our Boost tests is armeabi-v7a.

Example:


[2/2] Linking �[33mbuild/.conf_check_7cf3e2ff755f756d861b132473258c5c/testbuild/testprog�[0m

['/<Sanitized>/androidNDK/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++', '--target=arm-linux-androideabi23', '-stdlib=libc++', '-static-libstdc++', 'test.cpp.1.o', '-o/<Sanitized>/build/.conf_check_7cf3e2ff755f756d861b132473258c5c/testbuild/testprog', '-Wl,-Bstatic', '-L/<Sanitized>/boost/lib/armeabi-v7a', '-lboost_chrono', '-lboost_filesystem', '-lboost_unit_test_framework', '-lboost_thread', '-lboost_system', '-lboost_date_time', '-lboost_program_options', '-lboost_regex', '-Wl,-Bdynamic', '-L/<Sanitized>/boost/lib/armeabi-v7a', '-landroid', '-llog', '-lGLESv2', '-lEGL']
err: test.cpp.1.o:test.cpp:function main: error: undefined reference to '__atomic_fetch_sub_4'
test.cpp.1.o:test.cpp:function main: error: undefined reference to '__atomic_fetch_sub_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>(): error: undefined reference to '__atomic_fetch_add_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>(): error: undefined reference to '__atomic_fetch_add_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>(): error: undefined reference to '__atomic_fetch_sub_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>(): error: undefined reference to '__atomic_fetch_sub_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_exception_>(): error: undefined reference to '__atomic_fetch_add_4'
test.cpp.1.o:test.cpp:function boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_exception_>(): error: undefined reference to '__atomic_fetch_add_4'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Circular Buffer Issues (all builds and NDK versions)

I have been experimenting with different boost build versions and different android NDK versions to try and get boost::circular_buffer to work properly without much luck.

I have experimented with building my own, but have also experimented with using the prebuilt releases (e.g., https://github.com/dec1/Boost-for-Android/releases).

image

I have experimented with various different built configurations but my current setup is the following.

CMake: 3.14.4
Android NDK: 19c
Android Gradle Plugin version: 3.4.1
Gradle version: 5.1.1
C++ compiler: Clang
C++ version: 14 (also tried 17)
OS: Windows

Note that I can import boost::circular_buffer and use various different methods but some of the boost classes themselves seem to me missing imports

Any help is greatly appreciated!

compile error

./boost/mpi/detail/mpi_datatype_primitive.hpp:28:51: fatal error: boost/serialization/detail/get_data.hpp: No such file or directory

the content of doIt.sh :

Specify the path to boost src dir

BOOST_SRC_DIR=/home/sindo/Downloads/boost_1_64_0

Specify the version of boost in the source dir

BOOST_VERSION=1.64.0

Specify path to (Google) Ndk

GOOGLE_DIR=/home/sindo/Downloads/ndk/android-ndk-r15c

Dont modify

export ANDROID_NDK_ROOT=$GOOGLE_DIR

Modify if desired

log file where build messages will be stored

logFile=build_out.txt
rm $logFile

the build script writes some extra info to this file if its defined (but will be in "split" across different dirs)

#export NDK_LOGFILE=ndk_log_out.txt

./build_tools/build-boost.sh --version=1.64.0 --stdlibs="gnu-4.9" --abis="armeabi-v7a" --ndk-dir=$ANDROID_NDK_ROOT --build-dir="/home/sindo/Downloads/boost_1_64_0/build" --linkage="static" --verbose $BOOST_SRC_DIR 2>&1 | tee -a $logFile

./build_tools/build-boost.sh --version=1.64.0 --stdlibs="gnu-4.9" --abis="armeabi-v7a" --ndk-dir=$ANDROID_NDK_ROOT --linkage="shared" --verbose $BOOST_SRC_DIR 2>&1 | tee -a $logFile


OS X Build failed unistd.h: No such file or directory

The build fails with

    "g++"   -O3 -finline-functions -Wno-inline -Wall -pedantic -Wextra -Wno-long-long -DBOOST_ALL_NO_LIB=1 -DBOOST_All_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-christian/tmp/build-57372/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/chrono/build/gcc-arm/release/abi-aapcs/binary-format-elf/link-static/target-os-android/threading-multi/thread_clock.o" "libs/chrono/src/thread_clock.cpp"

In file included from ./boost/config.hpp:48:0,
                 from ./boost/chrono/config.hpp:15,
                 from ./boost/chrono/detail/inlined/thread_clock.hpp:14,
                 from libs/chrono/src/thread_clock.cpp:18:
./boost/config/stdlib/libstdcpp3.hpp:78:22: fatal error: unistd.h: No such file or directory
 #  include <unistd.h>
                      ^
compilation terminated.
...failed updating 3 targets...
ERROR: Couldn't build Boost 1.65.1 armeabi-v7a libraries

XCode works, I did xcode-select --install but it didn't help..

Problem compiling on OSX

Hi,

I have followed instructions to the letter however I'm getting an error "...failed to update x targets..."

Im not sure if due to this step...

Create a symbolic link llvm-3.5 to llvm in google's ndk-bundle/toolchains dir (This is only necessary if you want to be able to build with clang)

I tried the following in repo root...

ln -s /Users/petertribe/Documents/android-ndk-r15c/toolchains/llvm llvm-35

Can you please provide an example what should be done...

How to build on Windows?

Hello,
thank you for sharing this project.
I try to build the libraries using cygwin to run the script file, but it fails. I get the following error messages:

ERROR: Unsupported HOST_TAG: cygwin-x86_64
Please update 'prepare_host_flags' in build/tools/prebuilt-common.sh
Checking whether the compiler generates 32-bit binaries...gcc -c -o /tmp/ndk-anton/tmp/tests/test-2600.o /tmp/ndk-anton/tmp/tests/test-2600.c
no
Building Boost 1.65.1 armeabi-v7a libraries (C++ stdlib: gnu-4.9)
Copying directory:
from /cygdrive/c/Users/anton/Downloads/boost_1_65_1/1.65.1
to /tmp/ndk-anton/tmp/build-2600/build-boost/armeabi-v7a/gnu-4.9/src

How to run the script on Windows correctly?

where should I put the headers/libraries?

Hi dec1,
I have built the result with static and shared libraries in install/ folder, and I put the headers into <{NDK_dir}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include>, and put libraries into <{NDK_dir}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/29>, x86_64 is my android emulator processor architecure, 29 is the android API version I want to user, NDK version is r21. But the result seems my project can find the header, but cannot find *.so
Are include and libraries folder right, thanks a lot.

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

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

Couldn't build Boost 1.65.1 with doIt.sh

Hi,
I tried to compile with the doIt.sh script, however I am not able to build it.
I have looked for those header inside my Ubuntu, and they are located inside /usr/include/asm-generic/
Do you know how to solve this problem?

also tried with
sudo apt-get install build-essential
sudo apt-get install ia32-libs

  "g++"   -O3 -finline-functions -Wno-inline -Wall -fPIC -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/polymorphic_oarchive.o" "libs/serialization/src/polymorphic_oarchive.cpp"

In file included from ./boost/config.hpp:48:0,
                from ./boost/serialization/config.hpp:18,
                from libs/serialization/src/polymorphic_oarchive.cpp:16:
./boost/config/stdlib/libstdcpp3.hpp:78:22: fatal error: unistd.h: No such file or directory
#  include <unistd.h>
                     ^
compilation terminated.
gcc.compile.c++ /tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/regex/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/winstances.o

   "g++"   -O3 -finline-functions -Wno-inline -Wall -pedantic -fPIC  -DBOOST_ALL_NO_LIB=1 -DBOOST_REGEX_DYN_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/regex/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/winstances.o" "libs/regex/build/../src/winstances.cpp"

In file included from ./boost/config.hpp:48:0,
                from ./boost/regex/config.hpp:44,
                from libs/regex/build/../src/winstances.cpp:21:
./boost/config/stdlib/libstdcpp3.hpp:78:22: fatal error: unistd.h: No such file or directory
#  include <unistd.h>
                     ^
compilation terminated.
gcc.compile.c++ /tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/extended_type_info.o

   "g++"   -O3 -finline-functions -Wno-inline -Wall -fPIC -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/extended_type_info.o" "libs/serialization/src/extended_type_info.cpp"

In file included from /home/altumview/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_algo.h:59:0,
                from /home/altumview/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/algorithm:62,
                from libs/serialization/src/extended_type_info.cpp:15:
/home/altumview/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cstdlib:72:20: fatal error: stdlib.h: No such file or directory
#include <stdlib.h>
                   ^
compilation terminated.
gcc.compile.asm /tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/context/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/asm/ontop_arm_aapcs_elf_gas.o

   "g++" -x assembler-with-cpp -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_CONTEXT_DYN_LINK=1 -DBOOST_CONTEXT_SOURCE -DBOOST_DISABLE_ASSERTS -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/context/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/asm/ontop_arm_aapcs_elf_gas.o" "libs/context/src/asm/ontop_arm_aapcs_elf_gas.S"

gcc.compile.c++ /tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/basic_serializer_map.o

   "g++"   -O3 -finline-functions -Wno-inline -Wall -fPIC -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/basic_serializer_map.o" "libs/serialization/src/basic_serializer_map.cpp"

In file included from ./boost/config.hpp:48:0,
                from ./boost/serialization/config.hpp:18,
                from libs/serialization/src/basic_serializer_map.cpp:22:
./boost/config/stdlib/libstdcpp3.hpp:78:22: fatal error: unistd.h: No such file or directory
#  include <unistd.h>
                     ^
compilation terminated.
...failed updating 18 targets...
ERROR: Couldn't build Boost 1.65.1 armeabi-v7a libraries

ERROR: Couldn't build Boost 1.65.1 armeabi-v7a libraries

build_out.txt

I have used standalone ndk to build the library and linked llvm to llvm3.5,
but still cannot build the library. looks like it failed at mpi.
I already apt-get install mpi, it still shows the error.
Need some help on build this library
attached my build_out.txt
using android-ndk-r16

Compiling boost with zlib

Hi, great work, very useful!

I need to use the gzip utilities in Boost.Iostreams, but for that I need to compile boost with zlib..
I understand that I need to specify ZLIB_INCLUDE, ZLIB_LIBPATH and ZLIB_BINARY when running ./b2.
Do you know where I can get these? I know that zlib is now part of the Android NDK, is there some way to use that?

Will appreciate your help.

Not able to build boost with bzip2 android prebuilt library

I am trying to add bzip2 dependency to boost for iostreams using BZIP2_NAME, BZIP2_LIBRARY_PATH AND BZIP2_INCLUDE but when i build boost it says bzip2 : no. Not sure whether i am doing something wrong any help would be appreciated.

Thanks in advance.

example_app: build command failed

Seems like there are relative paths in example_app.
Make Project gives:
"""
Build command failed.
Error while executing process /Users/aleksejkononov/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/aleksejkononov/Downloads/Boost-for-Android/example_app/app/.externalNativeBuild/cmake/debug/x86_64 --target native-lib}
ninja: error: '/home/declan/Documents/zone/low/Boost-for-Android/build/boost/1.68.0/libs/llvm/x86_64/libboost_system.so', needed by '../../../../build/intermediates/cmake/debug/obj/x86_64/libnative-lib.so', missing and no known rule to make it
"""
I think fixing this may be helpful for someone )

Add support for NDK r16 with unified headers

Hello,

With NDK r16 the old-style headers are gone and only Unified Headers are available. I guess that's what leads to the following error:

    "clang++" -x c++ -O3 -O3 -Wno-inline -Wall -pedantic -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c -o "/tmp/ndk-gjasny/tmp/build-79113/build-boost/armeabi-v7a/llvm-5.0/build/boost/bin.v2/libs/regex/build/clang-darwin-arm/release/abi-aapcs/binary-format-elf/link-static/target-os-android/threading-multi/regex_traits_defaults.o" "libs/regex/build/../src/regex_traits_defaults.cpp"

In file included from libs/regex/build/../src/regex_traits_defaults.cpp:20:
In file included from ./boost/regex/regex_traits.hpp:23:
In file included from ./boost/regex/config.hpp:44:
In file included from ./boost/config.hpp:44:
In file included from ./boost/config/detail/select_stdlib_config.hpp:18:
In file included from /Users/gjasny/Android/android-ndk-r16-beta1/sources/cxx-stl/llvm-libc++/include/cstddef:37:
/Users/gjasny/Android/android-ndk-r16-beta1/sources/cxx-stl/llvm-libc++/include/__config:169:10: fatal error: 'features.h' file not found
#include <features.h>
         ^~~~~~~~~~~~
1 error generated.

I'd expect some form of sysroot flag in the compiler invocation but could not spot one.

Thanks,
Gregor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.