Soundtouch library compile issue

谁说胖子不能爱 提交于 2019-12-11 16:06:15

问题


I am trying to compile Soundtouch library with Android NDK. I successfully installed Cygwin and SWIG required for Soundtouch library. When I try to run ndk-build.cmd, i am getting an error

jni/soundtouch/wrapper_wrap.cpp: In function 'void Java_com_talkingyeti_jni2_wrapperJNI_SoundTouch_1putSamples(JNIEnv*, _jclass*, jlong, _jobject*, jlong, jlong)': jni/soundtouch/wrapper_wrap.cpp:545: error: 'SAMPLETYPE' was not declared in this scope jni/soundtouch/wrapper_wrap.cpp:545: error: 'arg2' was not declared in this scope jni/soundtouch/wrapper_wrap.cpp:553: error: expected primary-expression before ')' token jni/soundtouch/wrapper_wrap.cpp:560: error: expected ')' before 'const' jni/soundtouch/wrapper_wrap.cpp:560: error: expected ')' before ';' token make: * [obj/local/armeabi/objs/soundtouch/wrapper_wrap.o] Error 1

This issue happens with the following block of 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 ;
  }

Please suggest me what all changes I need to make on the SAMPLETYPE to compile NDK properly and to generate SO file.


回答1:


It's seem you missed a header. Make sure you have:

#include "soundtouch/include/SoundTouch.h"

and

using namespace soundtouch;


来源:https://stackoverflow.com/questions/18783644/soundtouch-library-compile-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!