У меня есть проект Android NDK, который не выполняется во время NDK_Build библиотеки SoundTouch.
построить журнал
izzy@NebulaesGate:~/warspace/AudioAnalyzerLib/jni$ /home/izzy/warspace/adt-bundle-linux-x86-20140321/ndk/ndk-build
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 8 in /home/izzy/warspace/AudioAnalyzerLib/AndroidManifest.xml
Android NDK: WARNING: Ignoring invalid values in LOCAL_CPP_FEATURES definition in /home/izzy/warspace/AudioAnalyzerLib/jni/Android.mk: -fno-exceptions
[armeabi] Compile++ thumb: SoundTouch <= AAFilter.cpp
[armeabi] Compile++ thumb: SoundTouch <= BPMDetect.cpp
[armeabi] Compile++ thumb: SoundTouch <= cpu_detect_x86.cpp
[armeabi] Compile++ thumb: SoundTouch <= FIFOSampleBuffer.cpp
[armeabi] Compile++ thumb: SoundTouch <= FIRFilter.cpp
/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/FIRFilter.cpp: In static member function 'static soundtouch::FIRFilter* soundtouch::FIRFilter::newInstance()':
/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/FIRFilter.cpp:294:10: warning: variable 'uExtensions' set but not used [-Wunused-but-set-variable]
[armeabi] Compile++ thumb: SoundTouch <= mmx_optimized.cpp
[armeabi] Compile++ thumb: SoundTouch <= PeakFinder.cpp
/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/PeakFinder.cpp: In member function 'int soundtouch::PeakFinder::findCrossingLevel(float const*, float, int, int) const':
/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/PeakFinder.cpp:146:11: warning: variable 'peaklevel' set but not used [-Wunused-but-set-variable]
[armeabi] Compile++ thumb: SoundTouch <= RateTransposer.cpp
/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/RateTransposer.cpp: In member function 'void soundtouch::RateTransposer::processSamples(const SAMPLETYPE*, uint)':
/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/RateTransposer.cpp:133:10: warning: variable 'count' set but not used [-Wunused-but-set-variable]
[armeabi] Compile++ thumb: SoundTouch <= SoundTouch.cpp
[armeabi] Compile++ thumb: SoundTouch <= sse_optimized.cpp
[armeabi] Compile++ thumb: SoundTouch <= TDStretch.cpp
/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/TDStretch.cpp: In static member function 'static soundtouch::TDStretch* soundtouch::TDStretch::newInstance()':
/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/TDStretch.cpp:627:10: warning: variable 'uExtensions' set but not used [-Wunused-but-set-variable]
[armeabi] SharedLibrary : libSoundTouch.so
/home/izzy/warspace/adt-bundle-linux-x86-20140321/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/izzy/warspace/AudioAnalyzerLib/obj/local/armeabi/objs/SoundTouch/SoundTouch/RateTransposer.o: in function soundtouch::TransposerBase::newInstance():/home/izzy/warspace/AudioAnalyzerLib/jni/SoundTouch/RateTransposer.cpp:284: error: undefined reference to 'soundtouch::InterpolateLinearInteger::InterpolateLinearInteger()'
collect2: ld returned 1 exit status
make: *** [/home/izzy/warspace/AudioAnalyzerLib/obj/local/armeabi/libSoundTouch.so] Error 1
Я знаю, что у него есть неопределенная ошибка ссылки, но я не понимаю этого. RateTransposer.cpp включает в себя InterpolateLinear.h
#include "InterpolateLinear.h"
Это код, который не работает
#ifdef SOUNDTOUCH_INTEGER_SAMPLES
// Notice: For integer arithmetics support only linear algorithm (due to simplest calculus)
return new InterpolateLinearInteger; # <<<<<________________LINE 284
#else
Это мой файл Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CPP_FEATURES += -fno-exceptions
LOCAL_SRC_FILES := \
SoundTouch/AAFilter.cpp \
SoundTouch/BPMDetect.cpp \
SoundTouch/cpu_detect_x86.cpp\
SoundTouch/FIFOSampleBuffer.cpp \
SoundTouch/FIRFilter.cpp \
SoundTouch/mmx_optimized.cpp \
SoundTouch/PeakFinder.cpp \
SoundTouch/RateTransposer.cpp \
SoundTouch/SoundTouch.cpp \
SoundTouch/sse_optimized.cpp \
SoundTouch/TDStretch.cpp
LOCAL_MODULE := libSoundTouch
LOCAL_C_INCLUDES := include/ #include/BPMDetect.h include/FIFOSampleBuffer.h include/FIFOSamplePipe.h include/SoundTouch.h include/STTypes.h
LOCAL_CFLAGS += -Wall -fvisibility=hidden -I include -D ST_NO_EXCEPTION_HANDLING -fdata-sections -ffunction-sections -marm
include $(BUILD_SHARED_LIBRARY)
Спасибо за вашу помощь,
Джо
Я понял это.
Я добавил SoundTouch / InterpolateLinear.cpp в мой файл Android.mk как раз перед RateTransposer.cpp …