1

NDK ビルドを実行しようとすると、次のエラーが表示されます...誰か助けてくれますか?

lmImf/ImfHuf.cpp:133: undefined reference to `__cxa_throw'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o): In function `Imf::(anonymous namespace)::invalidTableEntry()':
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:141: undefined reference to `__cxa_allocate_exception'
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:141: undefined reference to `__cxa_throw'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o): In function `Imf::(anonymous namespace)::tooMuchData()':
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:93: undefined reference to `__cxa_allocate_exception'
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:93: undefined reference to `__cxa_throw'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o): In function `Imf::(anonymous namespace)::invalidCode()':
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:109: undefined reference to `__cxa_allocate_exception'
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:109: undefined reference to `__cxa_throw'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o): In function `invalidTableSize':
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:117: undefined reference to `__cxa_allocate_exception'
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:117: undefined reference to `__cxa_throw'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o): In function `invalidNBits':
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:85: undefined reference to `__cxa_allocate_exception'
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:85: undefined reference to `__cxa_throw'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o): In function `~AutoArray':
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfAutoArray.h:61: undefined reference to `__cxa_end_cleanup'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o): In function `Imf::hufUncompress(char const*, int, unsigned short*, int)':
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:1076: undefined reference to `__cxa_begin_catch'
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:1079: undefined reference to `__cxa_rethrow'
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfHuf.cpp:1076: undefined reference to `__cxa_end_catch'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o):(.ARM.extab.text._ZN3Imf13hufUncompressEPKciPti+0x0): undefined reference to `__gxx_personality_v0'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o): In function `~AutoArray':
    D:\Projects.CPP\Engine5\svn\trunk\Dependencies\FreeImage/D:/Projects.CPP/Engine5/svn/trunk/Dependencies/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfAutoArray.h:61: undefined reference to `__cxa_end_cleanup'
    ./obj/local/armeabi-v7a/libfreeimage.a(ImfHuf.o):(.ARM.extab.text._ZN3Imf11hufCompressEPKtiPc+0x0): undefined reference to `__gxx_personality_v0'
    /home/flock/ANDROID/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a(unwind-arm.o): In function `__gnu_unwind_pr_common':
    /i/ndk-andrewhsieh/src.1-with-cherrypicks//build/../gcc/gcc-4.4.3/libgcc/../gcc/config/arm/unwind-arm.c:1237: undefined reference to `__cxa_call_unexpected'
    collect2: ld returned 1 exit status

私のアプリケーション.mk

APP_OPTIM := release
APP_PLATFORM := android-8
APP_STL := gnustl_static
APP_CPPFLAGS += -frtti 
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -DANDROID
APP_ABI := armeabi-v7a

そして私のandroid.mk

 LOCAL_PATH := $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_MODULE:= freeimage
    LOCAL_SRC_FILES :=libfreeimage.a
    APP_STL := gnustl_static
    include $(PREBUILT_STATIC_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE:= imageprocessing
    LOCAL_SRC_FILES:= imageprocessing.c
    LOCAL_STATIC_LIBRARIES = freeimage
    LOCAL_EXPORT_C_INCLUDES := freeimage.h
    LOCAL_LDLIBS:= -lm -llog -ljnigraphics
    APP_STL := gnustl_static
    include $(BUILD_SHARED_LIBRARY)
4

2 に答える 2

1

これをあなたに追加してくださいApplication.mk

APP_STL := gnustl_static
APP_CPPFLAGS += -frtti 
APP_CPPFLAGS += -fexceptions

あなたの FreeImage は、アプリケーションとは異なるランタイムでビルドされているようです。

于 2012-07-26T09:26:16.757 に答える
0

本当に APP_STL : = stlport_static が不要でしたか? たとえば、「__cxa_end_catch」を grep すると、$(NDK_ROOT)/sources/cxx-stl/gabi++/... に表示され、gnustl_static (NDK (8c から 8e )ところで)

于 2013-05-21T14:45:48.597 に答える