我正在尝试用Android编译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: error:'SAMPLETYPE‘在此范围内未声明’soundtouch/包装_Wrap.cpp:545:错误:'arg2‘在此范围内未声明,jni/soundtouch/包装_Wrap.cpp:553:错误:预期的主-表达式前')’token jni/soundtouch/_Wrap.cpp:560:错误:预期‘’之前'const‘jni/soundtouch/包装器_ was :560:错误:预期的’);‘令牌生成:* obj/local/armeabi/objs/soundtouch/wrapper_wrap.o错误1
此问题发生在以下wrapper_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文件。
发布于 2013-10-24 11:34:37
你好像漏了一个头球。确保你有:
#include "soundtouch/include/SoundTouch.h"和
using namespace soundtouch;https://stackoverflow.com/questions/18783644
复制相似问题