Hi,
I've added a library to /external/. It uses STL and exceptions.
I'm trying to add a small command line utility to test the library. When I try to build the module, I get undefined symbols from the library:
error: undefined reference to '__cxa_allocate_exception'
error: undefined reference to '__cxa_throw'
error: undefined reference to '__gxx_personality_v0'
etc.
include $(CLEAR_VARS)
LOCAL_MODULE := wavsender
LOCAL_MODULE_TAGS := eng
LOCAL_CFLAGS += -fexceptions -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -DPLATFORM_ANDROID
LOCAL_CPPFLAGS += -Wno-non-virtual-dtor
LOCAL_SRC_FILES += WavSender.cpp
LOCAL_SHARED_LIBRARIES := libc libcutils libnetutils
LOCAL_STATIC_LIBRARIES := libcutils libopenhome
LOCAL_STATIC_LIBRARIES += libopenhome libgtest libgabi++ libstlport_static libstdc++
LOCAL_LDLIBS += -lstdc++
include $(BUILD_EXECUTABLE)
(sorry for the mess, just trying to get it to work ...)
androidabi-g++ comes out as:
prebuilt/darwin-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-g++ -nostdlib -Bdynamic -Wl,-T,build/core/armelf.x -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc -o out/target/product/generic/obj/EXECUTABLES/wavsender_intermediates/LINKED/wavsender -Lout/target/product/generic/obj/lib -Wl,-rpath-link=out/target/product/generic/obj/lib -lc -llog -lcutils -lnetutils -lc -lstdc++ -lm out/target/product/generic/obj/lib/crtbegin_dynamic.o out/target/product/generic/obj/EXECUTABLES/wavsender_intermediates/ohSongcast/WavSender/WavSender.o out/target/product/generic/obj/STATIC_LIBRARIES/liblog_intermediates/liblog.a out/target/product/generic/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a out/target/product/generic/obj/STATIC_LIBRARIES/libopenhome_intermediates/libopenhome.a out/target/product/generic/obj/STATIC_LIBRARIES/libopenhome_intermediates/libopenhome.a out/target/product/generic/obj/STATIC_LIBRARIES/libgtest_intermediates/libgtest.a out/target/product/generic/obj/STATIC_LIBRARIES/libgabi++_intermediates/libgabi++.a out/target/product/generic/obj/STATIC_LIBRARIES/libstlport_static_intermediates/libstlport_static.a out/target/product/generic/obj/STATIC_LIBRARIES/libstdc++_intermediates/libstdc++.a -Wl,-z,noexecstack -Wl,--icf=safe -Wl,--fix-cortex-a8 -Wl,--no-undefined prebuilt/darwin-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/armv7-a/libgcc.a out/target/product/generic/obj/lib/crtend_android.o
What am I doing wrong? I can't figure out how to get rid of the undefined symbols ...
thanks for any help