我一直试图安静地解决这个问题很长时间,我正在使用一个名为 FreeImage 的库,当尝试进行 NDK 构建时,代码会导致以下错误我的源代码可以从
copy.html">http://www.4shared.com/zip/1C3vpLI7/android-imagefilter-ndk_ copy .html 提前感谢您的宝贵努力-
tribute.cpp+0x8): undefined reference to `std::ios_base::Init::Init()'
ImfChromaticitiesAttribute.cpp:(.text.startup._GLOBAL__sub_I_ImfChromaticitiesAttribute.cpp+0x24): undefined reference to `std::ios_base::Init::~Init()'
/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/../../../../arm-linux-androideabi/bin/ld: Dwarf Error: mangled line number section.
./obj/local/armeabi/libfreeimage.a(ImfCompressionAttribute.o): In function `_GLOBAL__sub_I_ImfCompressionAttribute.cpp':
ImfCompressionAttribute.cpp:(.text.startup._GLOBAL__sub_I_ImfCompressionAttribute.cpp+0x8): undefined reference to `std::ios_base::Init::Init()'
ImfCompressionAttribute.cpp:(.text.startup._GLOBAL__sub_I_ImfCompressionAttribute.cpp+0x24): undefined reference to `std::ios_base::Init::~Init()'
./obj/local/armeabi/libfreeimage.a(ImfCompressor.o): In function `Imf::newCompressor(Imf::Compression, unsigned int, Imf::Header const&)':
ImfCompressor.cpp:(.text._ZN3Imf13newCompressorENS_11CompressionEjRKNS_6HeaderE+0x10): undefined reference to `__gnu_thumb1_case_uqi'
ImfCompressor.cpp:(.text._ZN3Imf13newCompressorENS_11CompressionEjRKNS_6HeaderE+0xb8): undefined reference to `__cxa_end_cleanup'
./obj/local/armeabi/libfreeimage.a(ImfCompressor.o):(.ARM.extab.text._ZN3Imf13newCompressorENS_11CompressionEjRKNS_6HeaderE+0x0): undefined reference to `__gxx_personality_v0'
./obj/local/armeabi/libfreeimage.a(ImfCompressor.o): In function `Imf::newTileCompressor(Imf::Compression, unsigned int, unsigned int, Imf::Header const&)':
ImfCompressor.cpp:(.text._ZN3Imf17newTileCompressorENS_11CompressionEjjRKNS_6HeaderE+0x12): undefined reference to `__gnu_thumb1_case_uqi'
ImfCompressor.cpp:(.text._ZN3Imf17newTileCompressorENS_11CompressionEjjRKNS_6HeaderE+0x64): undefined reference to `__cxa_allocate_exception'
ImfCompressor.cpp:(.text._ZN3Imf17newTileCompressorENS_11CompressionEjjRKNS_6HeaderE+0x8a): undefined reference to `__cxa_throw'
ImfCompressor.cpp:(.text._ZN3Imf17newTileCompressorENS_11CompressionEjjRKNS_6HeaderE+0xe4): undefined reference to `__cxa_end_cleanup'
./obj/local/armeabi/libfreeimage.a(ImfCompressor.o):(.ARM.extab.text._ZN3Imf17newTileCompressorENS_11CompressionEjjRKNS_6HeaderE+0x0): undefined reference to `__gxx_personality_v0'
./obj/local/armeabi/libfreeimage.a(ImfCompressor.o): In function `_GLOBAL__sub_I_ImfCompressor.cpp':
ImfCompressor.cpp:(.text.startup._GLOBAL__sub_I_ImfCompressor.cpp+0x8): undefined reference to `std::ios_base::Init::Init()'
ImfCompressor.cpp:(.text.startup._GLOBAL__sub_I_ImfCompressor.cpp+0x24): undefined reference to `std::ios_base::Init::~Init()'
./obj/local/armeabi/libfreeimage.a(ImfCompressor.o):(.data.rel.ro+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
/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/../../../../arm-linux-androideabi/bin/ld: Dwarf Error: mangled line number section.
./obj/local/armeabi/libfreeimage.a(ImfConvert.o): In function `_GLOBAL__sub_I_ImfConvert.cpp':
ImfConvert.cpp:(.text.startup._GLOBAL__sub_I_ImfConvert.cpp+0x8): undefined reference to `std::ios_base::Init::Init()'
ImfConvert.cpp:(.text.startup._GLOBAL__sub_I_ImfConvert.cpp+0x24): undefined reference to `std::ios_base::Init::~Init()'
/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/../../../../arm-linux-androideabi/bin/ld: Dwarf Error: mangled line number section.
./obj/local/armeabi/libfreeimage.a(ImfDoubleAttribute.o): In function `_GLOBAL__sub_I_ImfDoubleAttribute.cpp':
ImfDoubleAttribute.cpp:(.text.startup._GLOBAL__sub_I_ImfDoubleAttribute.cpp+0x8): undefined reference to `std::ios_base::Init::Init()'
ImfDoubleAttribute.cpp:(.text.startup._GLOBAL__sub_I_ImfDoubleAttribute.cpp+0x24): undefined reference to `std::ios_base::Init::~Init()'
/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/../../../../arm-linux-androideabi/bin/ld: Dwarf Error: mangled line number section.
./obj/local/armeabi/libfreeimage.a(ImfEnvmapAttribute.o): In function `_GLOBAL__sub_I_ImfEnvmapAttribute.cpp':
ImfEnvmapAttribute.cpp:(.text.startup._GLOBAL__sub_I_ImfEnvmapAttribute.cpp+0x8): undefined reference to `std::ios_base::Init::Init()'
ImfEnvmapAttribute.cpp:(.text.startup._GLOBAL__sub_I_ImfEnvmapAttribute.cpp+0x24): undefined reference to `std::ios_base::Init::~Init()'
我的安卓.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE:= freeimage
LOCAL_SRC_FILES :=libfreeimage.a
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
include $(BUILD_SHARED_LIBRARY)
我的应用程序.mk
APP_OPTIM := release
APP_PLATFORM := android-8
APP_STL := gnustl_static
APP_CPPFLAGS += -frtti
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -DANDROID
APP_ABI:= armeabi