【发布时间】:2012-03-21 07:46:24
【问题描述】:
我按照http://android.wooyd.org/JNIExample/ 上的教程进行操作,当我尝试使用 cygwin 构建时,我得到:
undefined reference to `android::AndroidRuntime::registerNativeMethods(_JNIEnv*, char const*, JNINativeMethod const*, int)'
在包含中,我发现了如下声明的 registerNativeMethods 函数:
static int registerNativeMethods(JNIEnv* env,
const char* className, const JNINativeMethod* gMethods, int numMethods);
当我将 const char * 和 JNINativeMethod [] 传递给它时,我不明白为什么编译器会将函数的输入读取为 char const * 和 JNINativeMethod const*。尽管我查看并发现它说 char const * 和 const char * 是相同的地方。如果是这样,为什么我会收到此错误。
如果有区别,我的 ndk 入口点是一个 c++ 文件,我使用的是股票 cygwin。
【问题讨论】:
标签: android-ndk cygwin