Boost-for-Android | Android port of Boost C Libraries | SDK library
kandi X-RAY | Boost-for-Android Summary
kandi X-RAY | Boost-for-Android Summary
Boost for android is a set of tools to compile the main part of the Boost C++ Libraries for the Android platform. Currently supported boost versions are 1.45.0, 1.48.0, 1.49.0, 1.53.0, 1.54.0, 1.55.0, 1.65.1, 1.66.0, 1.67.0, 1.68.0, 1.69.0, 1.70.0, 1.71.0, 1.73.0 and 1.74.0. x86, mips, and 64-bit architectures are built with Boost 1.65.1 and NDK r16-beta2, this version uses clang toolchain with llvm libc++ STL library. Other versions of Boost are built only for arm architecture, they are using gcc toolchain and gnustl library.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Boost-for-Android
Boost-for-Android Key Features
Boost-for-Android Examples and Code Snippets
Community Discussions
Trending Discussions on Boost-for-Android
QUESTION
I am trying to use the pre-compiled boost from silverglint. For some reason, the build system is not able to locate source files [these files are present in src/main/cpp/boost/]
...ANSWER
Answered 2019-Nov-19 at 22:39If the file is included at the path:
QUESTION
To be frank I'm at my wit's end and I really need a place to crash. While compiling I am keeping getting a
error: linker command failed with exit code 1 (use -v to see invocation)
I presume it is due to incompability or simply different compiler versions between the project build and the boost libraries but as long as I read the binaries are perfect compatible(?).
Building Boost
I compiled via MinGW on Windows 10 but to exclude errors here I ended up building boost using this git shell script which worked with the latest versions of Boost (1.64.0) and NDK (r15b). I did it in the VirtualBox with Ubuntu 16.04 since I had not enough knowledge to adapt it to Windows 10 (at least I was not able to). Now I have shard and static libs compiled with gnu-4.9 and llvm-3.5 for x86 (which my emulator in AStudio is baded on too).
Android Studio
I am using Cmake to build the C/C++ libraries of my project. I have several C libs and one C++ lib that are dependant from each other. The last is the one using boost. Since all libraries are built and found with no error it seems to be a name mangling problem to me though all C header files have the preprocessor declaration: extern C. Except for the boost parts all is running flawlessly
CMake
The find_package() REQUIRED parameter is set and the Boost_DEBUG tells that all components have been found. Since at a certain point I got the error
undefined reference to boost::system::generic_category()
I added system to the components, so my minimalistic components setup contains only chrono and system like suggested on many other threads concerning this particular problem. I tried to link the boost libs individually, without success:
...ANSWER
Answered 2017-Aug-03 at 08:36To sumarize the comments:
The compilation error "undefined reference to boost::system::generic_category()
" can be worked-around by adding the -DBOOST_SYSTEM_NO_DEPRECATED
to the compiler flags (see here for further details: undefined reference to boost::system::system_category() when compiling).
To limit the build only to x86, you can provide the abiFilters "x86"
in the "externalNativeBuild:cmake" section next to the cppFlags.
The dlopen()
problem:
When the library is linked dynamically, it needs to be also in the shared library search paths, otherwise it might not be found when actually running the executable. So the Boost shared libs path needs to be put to the PATH
(Windows) or LD_LIBRARY_PATH
(Linux) (if it is not in the standard locations like '/lib[64]' or '/usr/local/lib[64]').
Alternatively you can build with static libraries instead:
QUESTION
I had to build a version of boost for Android using NDK r18b, I had a hardtime achieving this so I post Question+Answer here as it may help other persons.
Firstly, I tried https://github.com/moritz-wundke/Boost-for-Android, but this was unsuccessful, see How to build boost 1.69.0 for Android with NDK r18b using moritz-wundke/Boost-for-Android?.
Secondly, I tried https://github.com/dec1/Boost-for-Android, but this was unsuccessful too, see How to build boost 1.69.0 for Android with NDK r18b using dec1/Boost-for-Android?.
What are the steps to follow to achieve compilation of boost?
...ANSWER
Answered 2019-Jan-28 at 08:40Actually, those scripts were designed for Linux, and they hardly work under Windows. Then, I started from scratch and could finally find the good config under Windows to achieve this. I basically checked how other libraries are compiled (I use QtCreator to deploy on Android, so the compilation window reported me how clang++ has to be invoked, so I write a user-config.jam based on that.
Here are the steps to follow to compile boost 1.68.0 for Android armeabiv7 and x86 using NDK r18b:
- Download boost 1.68.0 from boost.org: https://www.boost.org/users/history/version_1_68_0.html
- Apply moritz-wundke's patch, else it won't compile (thanks by the way). Take it from here: https://github.com/moritz-wundke/Boost-for-Android/tree/master/patches
- Run
bootstrap.bat
(you'll need it to find a compiler, I have VS 2015 installed so it works just fine)
Then set some environment variables:
QUESTION
I tried to use https://github.com/dec1/Boost-for-Android to compile boost for Android. It reports 1.69.0 is supported for NDK r18b. I'm under Windows 7.
Even if this is reported as working, I encounter many problems when trying to run the provided script:
- Downloaded boost 1.69.0
- Downloaded sources
- Modified BOOST_SRC_DIR to point to folder containing "1.69.0" boost folder
- Modified ANDROID_NDK_ROOT to point to ndk folder
- Modified ABIS="armeabi-v7a,x86"
- Modified LINKAGE="static"
- Added Cygwin to my path (as this is a .sh file I need to run)
- Ran
doIt.sh
Got non blocking errors:
...
ANSWER
Answered 2019-Jan-23 at 10:21Sorry, only building on linux is officially supported. Mac and Windows should work fine too but details of setting up the relevant environments (eg cgwin or homebrew) is beyond the scope of what this project tries to do.
If you want to use windows as a host you have two easiest options are:
Use virtual machines eg. VirtualBox or and create a linux virtual machine where you do the building.
You can also simply download and use the precompiled binaries I have made available
No matter what os you use to build under, the resulting binaries can then be copied to windows and used from then on as if you had built on windows to start with (theyre cross compiled for android).
QUESTION
I am currently trying to use the boost::regex library in my Android native lib on Android Studio. But I get this two linker errors:
F:\Tools\dev\Android\ndks\crystax-ndk-10.3.2/sources/boost/1.64.0/include/boost/regex/v4/regex_search.hpp:56: error: undefined reference to 'boost::re_detail_106400::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator<__gnu_cxx::__normal_iterator, std::allocator > > > >, boost::regex_traits > >::find()'
F:\Tools\dev\Android\ndks\crystax-ndk-10.3.2/sources/boost/1.64.0/include/boost/regex/v4/perl_matcher.hpp:383: error: undefined reference to 'boost::re_detail_106400::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator<__gnu_cxx::__normal_iterator, std::allocator > > > >, boost::regex_traits > >::construct_init(boost::basic_regex > > const&, boost::regex_constants::_match_flags)'
I am using the crystax-ndk (10.3.2) to compile my native c++ code. The boost library is version 1.64.0 and I use the precompiled static libs from here.
My build.gradle looks like this:
...ANSWER
Answered 2018-May-22 at 09:14I fixed my problem by changing from crystax to Android NDK r16b with CMake and setting the std
lib to c++11
.
In the build.gradle
:
QUESTION
I have an issue when compiling my code using Boost for Android with Android Studio ndk. I am using one of the libraries libboost_filesystem-clang-mt-a32-1_66.a from boost, however, it shows following error:
...ANSWER
Answered 2018-Mar-09 at 08:52Your boost library was built with libc++ (you can tell because it has references to std::__ndk1::*
rather than just std::*
). You need to use libc++, not gnustl.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Boost-for-Android
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page