Error Undefined Reference To Android Ndk
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of android ndk undefined reference to static library this site About Us Learn more about Stack Overflow the company Business ndk undefined reference to __android_log_print' Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask
Ndk Build Undefined Reference To
Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign
Android Ndk Undefined Reference Shared Library
up android ndk undefined reference to a method up vote 3 down vote favorite Hi Sorry for the long post I am trying to compile some static classes namely jsmn.c,json.c and buf.c which are part of the jsmn json library I downloaded from https://github.com/alisdair/jsmn-example/downloads. I am compiling two STATIC_LIBRARIES lib1 and json_librrary.lib1 has native code which is dependent on json_library.Then I am making undefined reference to 'stpcpy' two libraries into a shared library containing gnustl_static AND lib1 My folder structure is as follows jni/lib1/ANdroid.mk include $(CLEAR_VARS) LOCAL_MODULE := json_library LOCAL_SRC_FILES := /3rdParty/jsmn/json_library.a LOCAL_SRC_FILES := /3rdParty/jsmn/jsmn.c /3rdParty/jsmn/buf.c /3rdParty/jsmn/log.c /3rdParty/jsmn/json.c LOCAL_C_INCLUDES := /3rdParty/jsmn/jsmn.h /3rdParty/jsmn/buf.h /3rdParty/jsmn/log.h /3rdParty/jsmn/json.h # Optional compiler flags. LOCAL_LDLIBS = -lz -lm LOCAL_CFLAGS = -Wall -pedantic -std=c99 -g include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) # Module Name LOCAL_MODULE := lib1 LOCAL_STATIC_LIBRARIES := json_library ........ ....... ...... include $(BUILD_STATIC_LIBRARY) jni/Android.mk # Here we give our module name LOCAL_MODULE := lib2 # list the static modules included here!!! LOCAL_STATIC_LIBRARIES := gnustl_static lib1 .... include $(BUILD_SHARED_LIBRARY) jni/Application.mk APP_MODULES := lib2 # Optimization for release APP_OPTM := release #Targets APP_ABI := armeabi-v7a armeabi So inside the lib1 I have class which calls a method from the json library named json_tokenise #include
here for a
Gnustl_static
quick overview of the site Help Center Detailed local_shared_libraries answers to any questions you might have Meta Discuss the workings and local_static_libraries policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or http://stackoverflow.com/questions/13080345/android-ndk-undefined-reference-to-a-method posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes http://stackoverflow.com/questions/28578830/why-is-ndk-throwing-undefined-reference-error-on-build a minute: Sign up Why is NDK throwing Undefined Reference error on Build? up vote 3 down vote favorite I've got this error while I'm trying to build an library with ndk: $ /cygdrive/d/android-ndk-r10d/ndk-build.cmd [armeabi] SharedLibrary : libgame.so jni/core/src/coreApplication.cpp:9: error: undefined reference to 'CCoreMessaging::CCoreMessaging()' jni/core/src/coreApplication.cpp:11: error: undefined reference to 'CCoreScreenContainer::CCoreScreenContainer()' jni/core/src/coreReference.h:75: error: undefined reference to 'CCoreRefClass::_RemoveRef(void*, bool)' jni/core/src/coreReference.h:76: error: undefined reference to 'CCoreRefClass::_AddRef(void*, bool)' jni/core/src/coreReference.h:58: error: undefined reference to 'CCoreRefClass::_RemoveRef(void*, bool)' jni/core/src/coreReference.h:58: error: undefined reference to 'CCoreRefClass::_RemoveRef(void*, bool)' jni/core/src/coreApplication.h:12: error: undefined reference to 'CCoreMessaging::~CCoreMessaging()' jni/core/src/coreReference.h:58: error: undefined reference to CCoreRefClass::_RemoveRef(void*, bool)' collect2.exe: error: ld returned 1 exit status make.exe: *** [obj/local/armeabi/libgame.so] Error 1 coreApplication.h:
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://stackoverflow.com/questions/27141771/android-ndk-linking-undefined-reference-when-linking-with-a-static-lib the workings and policies of this site About Us Learn more about http://stackoverflow.com/questions/24154356/undefined-reference-to-library-android-ndk Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each undefined reference other. Join them; it only takes a minute: Sign up Android NDK linking, “undefined reference” When linking with a Static Lib up vote 0 down vote favorite Environment android-ndk-r10c VisualGDB Windows x64 Use-case 1 ADB Cmdline executable ( no Java / APK ) is consist of several C++ files Executable is compiled having "APP_STL := gnustl_static" at Application.mk undefined reference to Executable is successfully compiled and running Use-case 2 The ADB tool of Use-case 1 is split into two separate projects A static library encapsulating general purpose functionality The ADB Tool minus the functionality moved out to the static lib Executable & static Lib are compiled having "APP_STL := gnustl_static" at Application.mk ADB Exe is compiled having LOCAL_LDLIBS := -L$(PATH_TO_STATIC_LIB) -lstaticlib Compilation fail with "undefined reference to `std::terminate()'" Linker error Problem at hand When compiling all CPP files as one project all goes fine, no linker error. When spiting the logic into a thin executable and a staticlib (that the executable is linked against ) I get an "undefined reference to `std::terminate()'" Linker error. It seems to me as if "gnustl_static" is not linked with the executable although "APP_STL := gnustl_static" is specified... What am I missing here? Is there any way to force 'gnustl_static' to link ? The make files for reference: Makefile where all files are part of the same executable (WORKING) Application.mk APP_STL := gnustl_static APP_ABI := all APP_CFLAGS := -std=gnu++1
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Undefined reference to Library android NDK up vote 0 down vote favorite I am working with android ndk and I got this error when build my project: error: undefined reference to 'std::basic_string