我想在Android上编译SoundTouch。我从这个配置行开始:stdexcept在Android上
./configure CPPFLAGS =“ - I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include /”LDFLAGS =“ - Wl,-rpath-link =/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 --no-recursion
由于Android NDK的目标是ARM,我还必须更改Makefile以删除-msse2标志以取得进展。
当我运行“制作”,我得到:
/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库。
2010-04-23
David R.