0

I am trying to build a Android NDK project including two libraries:

OpenCV and Boost

I think that including openCV worked fine, but I have problems with boost. To build boost I followed the instructions here: https://github.com/MysticTreeGames/Boost-for-Android I used Boost 1.53 and Android NDK r8e to build boost.

I set up my make files like this:

Application.mk

APP_PLATFORM          := android-8
APP_ABI               := armeabi-v7a
APP_OPTIM             := debug
NDK_DEBUG             := 1

APP_STL               := gnustl_static
APP_CPPFLAGS          := -fexceptions -frtti

Android.mk

LOCAL_PATH := $(call my-dir)


include ./jni/opencv/sdk/native/jni/OpenCV.mk
include ./jni/boost/lib/boost.mk
include ./jni/usit/usit.mk

boost.mk

LOCAL_PATH := $(call my-dir)

# boost_filesystem
#
include $(CLEAR_VARS)
LOCAL_MODULE := boost_filesystem
LOCAL_SRC_FILES := libboost_filesystem-gcc-mt-1_53.a
include $(PREBUILT_STATIC_LIBRARY)

# boost_thread
#
include $(CLEAR_VARS)
LOCAL_MODULE := boost_regex
LOCAL_SRC_FILES := libboost_regex-gcc-mt-1_53.a
include $(PREBUILT_STATIC_LIBRARY)

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

# boost_system
#
include $(CLEAR_VARS)
LOCAL_MODULE := boost_date_time
LOCAL_SRC_FILES := libboost_date_time-gcc-mt-1_53.a
include $(PREBUILT_STATIC_LIBRARY)

To set this up I followed this example: How to use the boost library (including shared_ptr) with the Android NDK and STLport

But I am getting this error:

/home/tassilo/android-ndks/android-ndk-r8e/build/core/build-executable.mk:23: *** Android NDK: Missing LOCAL_MODULE before including BUILD_EXECUTABLE in jni/Android.mk    .  Stop.

when trying to run ndk-build.

All my sources are available here: https://github.com/4ndro1d/irisrec.git

My target is to compile the file wahet.cpp without errors.

Community
  • 1
  • 1
4ndro1d
  • 2,926
  • 7
  • 35
  • 65
  • Just out of curiosity: wouldn't it be simpler to build Boost using it's own `b2` tool, [with the NDK](http://stackoverflow.com/questions/17667978/using-boost-in-android-ndk-with-windows/17672227#17672227), and then just reference Boost static libs from your mk file? – Igor R. May 21 '14 at 16:58
  • I honestly have no idea. I'm totally new to JNI and NDK stuff. – 4ndro1d May 22 '14 at 12:30
  • Then I'd suggest to try and build Boost normally, with `b2`, and then just link the resulting libs. – Igor R. May 22 '14 at 13:01

0 Answers0