0

NDKビルドを実行しようとすると、次のエラーログが表示されます。これは、間違ったC ++コンパイラに対してコードをコンパイルしたためと思われます。現在、GNUC++を使用しています。コマンドを使用しています。

APP_STL := gnustl_static

別のバージョンのコンパイラと使用可能な別のコンパイラを使用する方法を教えてください。

./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `std::_Rb_tree_const_iterator<std::pair<Imf::Name const, Imf::Channel> >::operator++()':
/home/flock/ANDROID/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:259: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `Imf::Pxr24Compressor::uncompress(char const*, int, Imath::Box<Imath::Vec2<int> >, char const*&)':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfPxr24Compressor.cpp:431: undefined reference to `__cxa_allocate_exception'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `tooMuchData':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfPxr24Compressor.cpp:173: undefined reference to `__cxa_throw'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfPxr24Compressor.cpp:173: undefined reference to `__cxa_allocate_exception'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `std::_Rb_tree_const_iterator<std::pair<Imf::Name const, Imf::Channel> >::operator++()':
/home/flock/ANDROID/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:259: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `Imf::Pxr24Compressor::compress(char const*, int, Imath::Box<Imath::Vec2<int> >, char const*&)':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfPxr24Compressor.cpp:404: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfPxr24Compressor.cpp:404: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `uiMult<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `uiAdd<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_throw'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `uiMult<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o): In function `uiAdd<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_throw'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfPxr24Compressor.o):(.data.rel.ro._ZTIN3Imf15Pxr24CompressorE[typeinfo for Imf::Pxr24Compressor]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./obj/local/x86/libFreeImage.a(ImfRleCompressor.o): In function `__static_initialization_and_destruction_0':
/home/flock/ANDROID/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/iostream:72: undefined reference to `std::ios_base::Init::Init()'
/home/flock/ANDROID/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/iostream:72: undefined reference to `std::ios_base::Init::~Init()'
./obj/local/x86/libFreeImage.a(ImfRleCompressor.o): In function `Imf::RleCompressor::uncompress(char const*, int, int, char const*&)':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfRleCompressor.cpp:283: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfRleCompressor.cpp:283: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfRleCompressor.o): In function `uiMult<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_throw'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfRleCompressor.o):(.data.rel.ro._ZTIN3Imf13RleCompressorE[typeinfo for Imf::RleCompressor]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./obj/local/x86/libFreeImage.a(ImfZipCompressor.o): In function `__static_initialization_and_destruction_0':
/home/flock/ANDROID/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/iostream:72: undefined reference to `std::ios_base::Init::Init()'
/home/flock/ANDROID/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/iostream:72: undefined reference to `std::ios_base::Init::~Init()'
./obj/local/x86/libFreeImage.a(ImfZipCompressor.o): In function `Imf::ZipCompressor::uncompress(char const*, int, int, char const*&)':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfZipCompressor.cpp:192: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfZipCompressor.cpp:192: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfZipCompressor.o): In function `Imf::ZipCompressor::compress(char const*, int, int, char const*&)':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfZipCompressor.cpp:159: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmImf/ImfZipCompressor.cpp:159: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfZipCompressor.o): In function `uiMult<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfZipCompressor.o): In function `uiAdd<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_throw'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfZipCompressor.o): In function `uiMult<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:69: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfZipCompressor.o): In function `uiAdd<unsigned int>':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_throw'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h:105: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(ImfZipCompressor.o):(.data.rel.ro._ZTIN3Imf13ZipCompressorE[typeinfo for Imf::ZipCompressor]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./obj/local/x86/libFreeImage.a(IlmThread.o): In function `IlmThread::Thread::start()':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:74: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:74: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(IlmThread.o): In function `~Thread':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:67: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:67: undefined reference to `__cxa_throw'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:67: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:67: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(IlmThread.o): In function `Thread':
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:61: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:61: undefined reference to `__cxa_throw'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:61: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/OpenEXR/./IlmThread/IlmThread.cpp:61: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(IlmThread.o):(.data.rel.ro._ZTIN9IlmThread6ThreadE[typeinfo for IlmThread::Thread]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
./obj/local/x86/libFreeImage.a(IlmThread.o):(.data.rel.ro._ZTIN3Iex9NoImplExcE[typeinfo for Iex::NoImplExc]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./obj/local/x86/libFreeImage.a(dcraw_common.o): In function `LibRaw::stretch()':
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:9060: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:9060: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(dcraw_common.o): In function `LibRaw::fuji_rotate()':
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:9015: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:9015: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(dcraw_common.o): In function `LibRaw::median_filter()':
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:4429: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:4429: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(dcraw_common.o): In function `LibRaw::remove_zeroes()':
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:337: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:337: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(dcraw_common.o): In function `LibRaw::recover_highlights()':
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:4521: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:4521: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(dcraw_common.o): In function `LibRaw::blend_highlights()':
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:4493: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:4493: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(dcraw_common.o): In function `LibRaw::scale_colors()':
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:3789: undefined reference to `__cxa_allocate_exception'
/home/flock/Desktop/FreeImage/jni/../Source/LibRawLite/./internal/dcraw_common.cpp:3789: undefined reference to `__cxa_throw'
./obj/local/x86/libFreeImage.a(dcraw_common.o): In function  
4

2 に答える 2

0

追加してみる

- Android.mk ファイルの LOCAL_CXXFLAGS に対する例外

Application.mk ファイルにもこれがあります

APP_STL := gnustl_static APP_ABI := すべて

-fexceptions を追加する前に同じエラーが発生していたと思います

于 2012-08-04T06:01:48.693 に答える
0

間違ったコンパイラを使用しているわけではありません。これは gcc/NDK のバグであり、Linux、Cygwin、および Windows (Cygwin 以外) ではわずかに異なって現れます。

これを修正するために私がしたことは次のとおりです(Linuxで機能し、盲目でCygwinを使用する必要がある開発者の1人で機能します)...

- APP_STL := gnustl_staticApplication.mk から次の行を削除します (NDK では壊れており、Linux Cygwin、Windows では少し異なる方法で壊れています)
- Android.mk ファイルの $(LOCAL_LDLIBS) に次の行を追加します。

$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a

また、次の 2 行を Andriod.mk に追加します。
LOCAL_C_INCLUDES := $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.6/include LOCAL_C_INCLUDES += $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include

これにより、Application.mk に "APP_STL := gnustl_static" を指定する必要があったことを達成できます。

于 2013-05-20T15:44:30.760 に答える