Android NDK undefined reference during linking -


i'm trying link executable created ndk-build existing .so library built ndk. here's android.mk file:

local_path := $(call my-dir)/.. include $(clear_vars) local_module := mini_executor local_c_includes := ../.. local_src_files := main.cpp local_cxxflags += -std=c++11 local_static_libraries := mylib include $(build_executable) 

i'm getting ton of undefined references when try build it, implies me linking process not working. sure enough, if enable switch v=1 on ndk-build, see following lines:

"compile++ thumb : mini_executor <= main.cpp c:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -mmd -mp -mf ./obj/local/armeabi/objs/mini_executor/main.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -mthumb -os -g -dndebug -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -i../.. -ic:/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/include -ic:/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include -ic:/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/include/backward -ijni/.. -dandroid  -wa,--noexecstack -wformat -werror=format-security  -std=c++11    -ic:/android-ndk-r9/platforms/android-3/arch-arm/usr/include -c  jni/../main.cpp -o ./obj/local/armeabi/objs/mini_executor/main.o  executable     : mini_executor c:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -wl,--gc-sections -wl,-z,nocopyreloc --sysroot=c:/android-ndk-r9/platforms/android-3/arch-arm ./obj/local/armeabi/objs/mini_executor/main.o c:/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a -lgcc -no-canonical-prefixes  -wl,--no-undefined -wl,-z,noexecstack -wl,-z,relro -wl,-z,now   -lc -lm -o ./obj/local/armeabi/mini_executor 

the thing notice in commands there linking existing .so file specified in .mk file. i've tried using both local_shared_libraries , local_static_libraries, neither 1 anything. doesn't appear if it's trying link library. missing here?

you need add android.mk file:

include $(clear_vars) local_module := mylib local_src_files := <path_to_mylib>/libmylib.a include $(prebuilt_static_library) 

the allows prebuilt static library included in project.

check out docs/prebuilts.html more information.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -