Integrate boost in iOS / Android - Plunge Interactive

Integrate boost in iOS / Android

This is a little guide to integrate C++ library boost on Xcode (iOS) and Eclipse (Android).

To start with the integration continue reading…

IOS

Mini guide that helped me:

http://www.whiterabbitsoftware.com/index.php/blog/item/boost

1- Download ZIP from here:
https://github.com/mz2/boostoniphone

2- Extract the ZIP into a folder.

3- Download your version of Boost (.tar.bz2) from:
http://www.boost.org/

4- Copy the boost downloaded file to the previous folder you created for the ZIP extraction.

5- Edit “boost.sh” file and search and replace all versions to match to the one you downloaded (i.e. 1_51_0 to 1_52_0).

6- Run: sh boost.sh

7- When finish, add to the project in “Build Phases” the “boost.framework “folder generated.

ANDROID

1- Download ZIP from here:
https://github.com/MysticTreeGames/Boost-for-Android

2- Extract ZIP into a folder and edit “build-android.sh”

3- Change all “53” to your version.

4- Add under the line “extact_parameters $@” this:
PARAMETERS=”/path/to/your/ndk/folder”
echo “——- Using AndroidNDKRoot = $PARAMETERS”

5- Repeat steps 3 and 4 from “Boost to IOS” (Download from boost.org)

6- Copy the folders inside the generated “Build” folder to the “jni” folder of your project. So the file structure will be:

jni
–>Android.mk
–>Application.mk
–>boost/
–>include/
–>lib/
–>hellocpp/

7- Add this to Android.mk for each library of boost you need to use, in this example I used 3 libraries:
# boost_regex
#
include $(CLEAR_VARS)
LOCAL_MODULE := boost_regex
LOCAL_SRC_FILES := boost/lib/libboost_regex-gcc-mt-1_53.a
include $(PREBUILT_STATIC_LIBRARY)

# boost_thread
#
include $(CLEAR_VARS)
LOCAL_MODULE := boost_thread
LOCAL_SRC_FILES := boost/lib/libboost_thread-gcc-mt-1_53.a
include $(PREBUILT_STATIC_LIBRARY)

# boost_system
#
include $(CLEAR_VARS)
LOCAL_MODULE := boost_system
LOCAL_SRC_FILES := boost/lib/libboost_system-gcc-mt-1_53.a
include $(PREBUILT_STATIC_LIBRARY)

LOCAL_C_INCLUDES += $(LOCAL_PATH)/boost/include/boost-1_53

LOCAL_STATIC_LIBRARIES += boost_regex \
boost_thread \
boost_system

8- The order in LOCAL_STATIC_LIBRARIES must be the same as the LOCAL_MODULE.

This site uses cookies to store information on your computer. Some cookies on this site are essential, and the site won't work as expected without them. Read more about them

ACCEPT