I am trying to statically reference the assembly of open frames libfreeimage.a for the Android NDK (using a sample of my own activity as a template).
When I compile and link my project, I get many linker errors in the lines:
../../../lib/ndk/armeabi-v7a/libfreeimage.a(ImfTimeCodeAttribute.o): In function global constructors keyed to ImfTimeCodeAttribute.cpp': ImfTimeCodeAttribute.cpp:(.text+0x28): undefined reference to :: ios_base:: Init:: Init()" >
I believe this is a problem that can be fixed by adding a namespace to the code or using g ++ on top of gcc. I thought -lstdC ++ would fix the problem, but it is not.
Any help would be greatly appreciated.
Android.mk:
LOCAL_PATH := $(call my-dir)/tmp include $(CLEAR_VARS) LOCAL_MODULE := androidapp LOCAL_CFLAGS := -DFREEIMAGE_LIB\ -DANDROID_NDK \ -DDISABLE_IMPORTGL \ -mfpu=vfp -mfloat-abi=softfp \ -ffast-math -O3 -DFPM_ARM LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lstdc++ -ldl LOCAL_STATIC_LIBRARIES := android_native_app_glue LOCAL_LDLIBS += ../../../lib/ndk/armeabi-v7a/libfreeimage.a LOCAL_ARM_MODE := arm SRC-FILES := $(wildcard tmp/*.c*) SRC-FILES := $(SRC-FILES:tmp/%=%) LOCAL_SRC_FILES += $(SRC-FILES) APP_OPTIM := release APP_ABI := armeabi-v7a include $(BUILD_SHARED_LIBRARY) $(call import-module,android/native_app_glue)
LOCAL_PATH := $(call my-dir)/tmp include $(CLEAR_VARS) LOCAL_MODULE := androidapp LOCAL_CFLAGS := -DFREEIMAGE_LIB\ -DANDROID_NDK \ -DDISABLE_IMPORTGL \ -mfpu=vfp -mfloat-abi=softfp \ -ffast-math -O3 -DFPM_ARM LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lstdc++ -ldl LOCAL_STATIC_LIBRARIES := android_native_app_glue LOCAL_LDLIBS += ../../../lib/ndk/armeabi-v7a/libfreeimage.a LOCAL_ARM_MODE := arm SRC-FILES := $(wildcard tmp/*.c*) SRC-FILES := $(SRC-FILES:tmp/%=%) LOCAL_SRC_FILES += $(SRC-FILES) APP_OPTIM := release APP_ABI := armeabi-v7a include $(BUILD_SHARED_LIBRARY) $(call import-module,android/native_app_glue)
source share