Giter VIP home page Giter VIP logo

boost-for-android's Introduction

Boost for Android

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 and 1.49.0.

To compile Boost for Android you may use one of the following NDKs:

For boost 1.45.0

For boost 1.48.0 & 1.49.0

Quick Start

Dependencies

Usage

$ ./build-android.sh $(NDK_ROOT)

This command will download and build boost against the NDK specified and output the final headers and libs and in the build folder.

For more info about usage and available commands use --help

Now that you got boost compiled you must add it to your Android.mk file. First copy the inlcude and lib filder over to your jni folder. I copied it just into: /jni/boost/.

Add the following to your Android.mk (example for boost 1.48):

LOCAL_CFLAGS += -I$(LOCAL_PATH)/boost/include/boost-1_48
LOCAL_LDLIBS += -L$(LOCAL_PATH)/boost/lib/ -lboost_system -lboost_...

LOCAL_CPPFLAGS += -fexceptions
LOCAL_CPPFLAGS += -frtti

Now use ndk-build and have fun with it! Also note that you should build your project and Boost with one version of NDK - STL inside NDK r4 and NDK r5 are not compatible in some subtle details.

Troubleshooting

In case you encounter bunch of linker errors when building your app with boost, this might help:

Building from a 64 bit machine (linux)

Make sure you have installed the 32 bit libraries. Those are required to be able to use the NDK.

To install them just use the following

$ sudo apt-get install ia32-libs

NDK 7 (CrystaX)

Add -lgnustl_static AFTER all boost libraries to the LOCAL_LDLIBS line in Android.mk. Example:

LOCAL_LDLIBS += lboost_system-gcc-md lboost_thread-gcc-md -lgnustl_static

NDK 8 (official)

Do everything that is in the NDK 7 Crystax section, but also add full path to the gnustl_static library to the link paths. Example:

LOCAL_LDLIBS += lboost_system-gcc-md lboost_thread-gcc-md \
             -L$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi \
             -lgnustl_static

boost-for-android's People

Contributors

derkling avatar inetic avatar kkszysiu avatar madadam avatar moritz-wundke avatar pelya avatar

Watchers

 avatar  avatar  avatar

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.