博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android error--No implementation found for native Lcomd
阅读量:4662 次
发布时间:2019-06-09

本文共 1698 字,大约阅读时间需要 5 分钟。

       在利用NDK编译Cpp执行时,出现了No implementation found for native Lcom等错误,调试好久,才发现

XXX.h和XXX.cpp。在XXX.cpp里#include XXX.h。竟然出现了No implementation found for native Lcom。

然后,XXX.h删除。所有在XXX.cpp里实现,居然通过了。

       NDK是不能直接include 编译(javah)出来的XXX.h。假设真要包括至少要删减一些语句。

当然,能够include 其它.h文件。

/* DO NOT EDIT THIS FILE - it is machine generated */#include 
/* Header for class com_ndk_test_JniClient *///#ifndef _Included_com_ndk_test_JniClient//#define _Included_com_ndk_test_JniClient#ifdef __cplusplusextern "C" {#endif/* * Class: com_ndk_test_JniClient * Method: AddStr * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; */JNIEXPORT jstring JNICALL Java_com_ndk_test_JniClient_AddStr (JNIEnv *, jclass, jstring, jstring);/* * Class: com_ndk_test_JniClient * Method: AddInt * Signature: (II)I */JNIEXPORT jint JNICALL Java_com_ndk_test_JniClient_AddInt (JNIEnv *, jclass, jint, jint);#ifdef __cplusplus}#endif//#endif

#include "com_ndk_test_JniClient.h"#include 
#include
#ifdef __cplusplus extern "C" { #endif /* * Class: com_ndk_test_JniClient * Method: AddStr * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; */JNIEXPORT jstring JNICALL Java_com_ndk_test_JniClient_AddStr (JNIEnv *env, jclass arg, jstring instringA, jstring instringB){ jstring str = (*env)->NewStringUTF(env, "HelloWorld from JNI !"); return str; }/** Class: com_ndk_test_JniClient* Method: AddInt* Signature: (II)I*/JNIEXPORT jint JNICALL Java_com_ndk_test_JniClient_AddInt (JNIEnv *env, jclass arg, jint a, jint b){ return a + b;}#ifdef __cplusplus } #endif

转载于:https://www.cnblogs.com/brucemengbm/p/7095734.html

你可能感兴趣的文章
酒店之王——网络流——dinic
查看>>
Windows7单机部署Hbase
查看>>
理解iOS Event Handling
查看>>
CreateCompatibleDC与BitBlt 学习
查看>>
十、HQL查询
查看>>
主要的调用约定关键字
查看>>
出队列操作
查看>>
提交表单时为了防止重复提交的进度条
查看>>
对于保证浮点数计算的正确性,有两种常见方式
查看>>
描述用浏览器访问 www.baidu.com 的过程
查看>>
选项卡功能
查看>>
数据结构和算法单向链表一之单向链表的简单实现
查看>>
ArcGIS Engine中的Symbols详解(转载)
查看>>
TLV(类型—长度—值)格式及编码
查看>>
LeetCode--String刷题总结
查看>>
scrapy snippet
查看>>
Cryptography I 学习笔记 --- 绪论
查看>>
文本框中只能输入小于等于100的正整数
查看>>
Linux操作系统定时任务系统 Cron 入门
查看>>
JavaWeb_(SSH论坛)_三、用户模块
查看>>