2012-03-21 34 views
0

我也跟着上http://android.wooyd.org/JNIExample/发现教程,当我尝试建立与cygwin的,我得到:NDK建造没有通话功能正常

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。

回答

0

registerNativeMethods在libandroid_runtime.so中实现,它不能在ndk中找到。

样品已声明: 如果您的固件编码为1.5或更高版本,强烈建议您使用Android NDK而不是遵循本指南。

所以这个指南不适用于ndk,是为android源代码构建的