【问题标题】:stdexcept On AndroidAndroid 上的 stdexcept
【发布时间】:2011-02-11 14:35:48
【问题描述】:

我正在尝试在 Android 上编译 SoundTouch。我从这个配置行开始:

./configure CPPFLAGS="-I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/" LDFLAGS="-Wl,-rpath-链接=/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -L/Volumes/android-build/mydroid/development/ndk/build/platforms/android -3/arch-arm/usr/lib -nostdlib -lc" --host=arm-eabi --enable-shared=yes CFLAGS="-nostdlib -O3 -mandroid" host_alias=arm-eabi --no-create - -无递归

由于 Android NDK 以 ARM 为目标,我还必须更改 Makefile 以删除 -msse2 标志才能继续。

当我运行“make”时,我得到:

/bin/sh ../../libtool --tag=CXX   --mode=compile arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include  -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c -o FIRFilter.lo FIRFilter.cpp
libtool: compile:  arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c FIRFilter.cpp -o FIRFilter.o
FIRFilter.cpp:46:21: error: stdexcept: No such file or directory
FIRFilter.cpp: In member function 'virtual void soundtouch::FIRFilter::setCoefficients(const soundtouch::SAMPLETYPE*, uint, uint)':
FIRFilter.cpp:177: error: 'runtime_error' is not a member of 'std'
FIRFilter.cpp: In static member function 'static void* soundtouch::FIRFilter::operator new(size_t)':
FIRFilter.cpp:225: error: 'runtime_error' is not a member of 'std'
make[2]: *** [FIRFilter.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

这并不奇怪,因为 -nostdlib 标志是必需的。 Android 似乎既没有 stdexcept 也没有 stdlib。 我怎样才能克服编译 SoundTouch 的这个障碍?

猜测,可能有一些我不知道我应该使用的标志。我可以重构代码不使用stdexcept。可能有一种方法可以提取原始 stdexcept 源并引用它。我也许可以链接到预编译的 stdexcept 库。

【问题讨论】:

    标签: android compilation android-ndk soundtouch


    【解决方案1】:

    android ndk 提供的默认提供的 gcc 版本不支持异常。请参阅 http://www.crystax.net/android/ndk.php 了解替代版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-28
      • 1970-01-01
      • 2018-06-05
      • 2016-06-01
      • 2023-03-22
      • 1970-01-01
      • 2021-02-24
      • 2014-07-01
      相关资源
      最近更新 更多