我正在尝试使用Android NDK编译Soundtouch库。我成功安装了Soundtouch库所需的Cygwin和SWIG。当我尝试运行ndk-build.cmd时,我收到错误
jni / soundtouch / wrapper_wrap.cpp:在函数'void Java_com_talkingyeti_jni2_wrapperJNI_SoundTouch_1putSamples(JNIEnv *,_ jclass *,jlong,_jobject *,jlong,jlong)': jni / soundtouch / wrapper_wrap.cpp:545:错误:未在此范围内声明'SAMPLETYPE' jni / soundtouch / wrapper_wrap.cpp:545:错误:未在此范围内声明'arg2' jni / soundtouch / wrapper_wrap.cpp:553:错误:')'令牌之前的预期primary-expression jni / soundtouch / wrapper_wrap.cpp:560:错误:预期')'在'const'之前 jni / soundtouch / wrapper_wrap.cpp:560:错误:预期')'之前';'代币 make: * [obj / local / armeabi / objs / soundtouch / wrapper_wrap.o]错误1
以下blockper_wrap.cpp块发生此问题:
SWIGEXPORT void JNICALL Java_com_talkingyeti_jni2_wrapperJNI_SoundTouch_1putSamples(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) {
soundtouch::SoundTouch *arg1 = (soundtouch::SoundTouch *) 0 ;
SAMPLETYPE *arg2 = (SAMPLETYPE *) 0 ;
uint arg3 ;
uint *argp3 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(soundtouch::SoundTouch **)&jarg1;
arg2 = *(SAMPLETYPE **)&jarg2;
argp3 = *(uint **)&jarg3;
if (!argp3) {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null uint");
return ;
}
请建议我在SAMPLETYPE上进行的所有更改,以正确编译NDK并生成SO文件。
答案 0 :(得分:1)
看起来你错过了一个标题。确保你有:
#include "soundtouch/include/SoundTouch.h"
和
using namespace soundtouch;