Android NDK: Including boost c++ library -
i trying use boost library inside android application, using ndk. have found couple of success stories here , here, can't same me. trying use library in this link, boost thread library. in code below, trying include thread library, not math library. process used build boost libraries pretty same first link attached.
so far, seems have built boost libraries, when run ndk-build
, following error:
prebuilt : libboost_thread.a <= <ndk>/sources/ cp: omitting directory `path/to/ndk/sources/boost' make: *** [obj/local/armeabi/libboost_thread.a] error 1
obviously cp: omitting directory...
not error. thing i'm getting other next line, doesn't mean anything. error 1
here's android.mk file:
local_path := $(call my-dir) include $(clear_vars) local_static_libraries := boost_thread local_ldlibs := lboost_system-gcc-md lboost_thread-gcc-md -lgnustl_static local_ldlibs += lboost_system-gcc-md lboost_thread-gcc-md \ -l$(ndk_root)/sources/cxx-stl/gnu-libstdc++/libs/armeabi \ -lgnustl_static local_src_files := #cpp_sources local_module := com_example_ndkfile_cppmethods include $(build_shared_library) $(call import-module,boost)
and there's android.mk file in path/to/ndk/sources/boost/
:
local_path:= $(call my-dir) include $(clear_vars) local_module:= boost_thread local_src_files:= android/lib/libboost_thread.a local_export_c_includes := $(local_path) include $(prebuilt_static_library)
and humble application.mk file:
app_abi := armeabi armeabi-v7a app_stl := gnustl_static app_cppflags = -fexceptions
i built boost libraries using bjam
. of libboost_###.a
files in sources/boost/android/lib
folder.
what error i'm getting?
i built boost libraries using boost-for-android. have in boost/include/lib directory android makefile boost.mk
local_path := $(call my-dir) # boost_date_time # include $(clear_vars) local_module := boost_date_time local_src_files := libboost_date_time-gcc-mt-1_53.a include $(prebuilt_static_library) # 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_thread local_src_files := libboost_thread-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_program_options # include $(clear_vars) local_module := boost_program_options local_src_files := libboost_program_options-gcc-mt-1_53.a include $(prebuilt_static_library) # boost_chrono # include $(clear_vars) local_module := boost_chrono local_src_files := libboost_chrono-gcc-mt-1_53.a include $(prebuilt_static_library)
and module use of boost libraries looks this
local_path := $(call my-dir) # signalserver, executable # include $(clear_vars) local_cflags := -dtixml_use_ticpp #local_cflags += -ddebug local_static_libraries := boost_thread \ boost_system \ boost_filesystem \ boost_program_options \ boost_chrono \ local_static_libraries += ticpp \ tia \ tobicore \ tobiid \ tid \ gdf local_module := signalserver local_c_includes := $(local_path)/include local_c_includes += $(local_path)/extern/include local_c_includes += $(local_path)/../boost/include/boost-1_53 local_src_files := #cpp source include $(build_executable)
in addition have android.mk subdir makefiles listed
top_path := $(call my-dir) include $(top_path)/boost/lib/boost.mk include $(top_path)/signalserver/signalserver.mk . .
and application.mk:
app_platform := android-14 app_abi := armeabi-v7a #app_optim := debug #ndk_debug := 1 ndk_toolchain_version := 4.6 app_stl := gnustl_static app_cppflags := -fexceptions -frtti
Comments
Post a Comment