ndk 编译常见错误-你懂得

2023-11-28 20:32
文章标签 编译 常见 错误 ndk 懂得

本文主要是介绍ndk 编译常见错误-你懂得,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!


=====================

error:

Compile++ thumb  : AndroidCamera <= bufferqueue.cpp
jni/newBuffer/bufferqueue.cpp:10:17: fatal error: queue: No such file or directory

***

Answer:

添加Application.mk:

APP_CFLAGS += -fexceptions
APP_STL := gnustl_static


=====================

=====================

error:

error: 'printf' was not declared in this scope


***

Answer:添加头

#include "stdio.h"


=====================

=====================

error:

/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/AndroidCamera/newDecoder/DecodeLib.o: in function initDecode():jni/newDecoder/DecodeLib.cpp:29: error: undefined reference to 'avcodec_find_decoder'


***

Answer:

=====================

//没有在.h文件中找到方法
'CreateBQueue' was not declared in this scope 
//没有在.c/.cpp中找到对应的实现
AndroidCamera.cpp:58: error: undefined reference to 'CreateBQueue'


=====================

error:

/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/libavcodec.a: no archive symbol table (run ranlib)


***

Answer:

victormatoiMac:newDecoder ericyang$ lipo -info libavcodec.a 
input file libavcodec.a is not a fat file
Non-fat file: libavcodec.a is architecture: armv7
victormatoiMac:newDecoder ericyang$ lipo -info libavformat.a 
input file libavformat.a is not a fat file
Non-fat file: libavformat.a is architecture: armv7
victormatoiMac:newDecoder ericyang$ lipo -info libavutil.a 
input file libavutil.a is not a fat file
Non-fat file: libavutil.a is architecture: armv7
victormatoiMac:TestCamera ericyang$ lipo -info jni/libx264.a 
lipo: archive with no architecture specification: jni/libx264.a (can't determine architecture for it)
victormatoiMac:TestCamera ericyang$ lipo -info jni/libCorePlot-CocoaTouch.a 
input file jni/libCorePlot-CocoaTouch.a is not a fat file
Non-fat file: jni/libCorePlot-CocoaTouch.a is architecture: armv7


victormatoiMac:newDecoder ericyang$ ranlib libavcodec.a 
victormatoiMac:newDecoder ericyang$ ranlib libavformat.a 
ranlib: file: libavformat.a(os_support.o) has no symbols
victormatoiMac:newDecoder ericyang$ ranlib libavutil.a 




=====================

old archive libiary--error---0.10.2--

SharedLibrary  : libAndroidCamera.so
/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/libavcodec.a: no archive symbol table (run ranlib)
/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/libavutil.a: no archive symbol table (run ranlib)
/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/libavformat.a: no archive symbol table (run ranlib)
jni/newDecoder/DecodeLib.cpp:25: error: undefined reference to 'avcodec_register'
jni/newDecoder/DecodeLib.cpp:29: error: undefined reference to 'avcodec_find_decoder'
jni/newDecoder/DecodeLib.cpp:39: error: undefined reference to 'avcodec_alloc_context3'
jni/newDecoder/DecodeLib.cpp:49: error: undefined reference to 'avcodec_alloc_frame'
jni/newDecoder/DecodeLib.cpp:60: error: undefined reference to 'avcodec_open2'
jni/newDecoder/DecodeLib.cpp:65: error: undefined reference to 'av_init_packet'
jni/newDecoder/DecodeLib.cpp:68: error: undefined reference to 'ff_h264_decoder'
jni/newDecoder/DecodeLib.cpp:74: error: undefined reference to 'avcodec_close'
jni/newDecoder/DecodeLib.cpp:80: error: undefined reference to 'av_free'
collect2: error: ld returned 1 exit status

old archive libiary--error---0.81--

=====================

In file included from /Users/ericyang/android-ndk-r8d/platforms/android-14/arch-arm/usr/include/stdlib.h:40:0,from jni/newDecoder/ffmpeg/libavutil/log.c:32:
/Users/ericyang/android-ndk-r8d/platforms/android-14/arch-arm/usr/include/string.h:58:15: note: previous declaration of 'strncasecmp' was here
jni/newDecoder/ffmpeg/libavutil/log.c: In function 'colored_fputs':
jni/newDecoder/ffmpeg/libavutil/log.c:109:21: error: implicit declaration of function 'isatty' [-Werror=implicit-function-declaration]
** 移除 Werror



=====================

/Users/ericyang/android-ndk-r8d/platforms/android-14/arch-arm/usr/include/string.h:58:15: note: previous declaration of 'strncasecmp' was here
In file included from jni/newDecoder/ffmpeg/libavutil/parseutils.c:31:0:
jni/newDecoder/ffmpeg/libavutil/parseutils.h:146:25: warning: 'struct tm' declared inside parameter list [enabled by default]
jni/newDecoder/ffmpeg/libavutil/parseutils.h:146:25: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
jni/newDecoder/ffmpeg/libavutil/parseutils.c:450:74: warning: 'struct tm' declared inside parameter list [enabled by default]
jni/newDecoder/ffmpeg/libavutil/parseutils.c: In function 'small_strptime':
jni/newDecoder/ffmpeg/libavutil/parseutils.c:465:19: error: dereferencing pointer to incomplete type
jni/newDecoder/ffmpeg/libavutil/parseutils.c:471:19: error: dereferencing pointer to incomplete type
jni/newDecoder/ffmpeg/libavutil/parseutils.c:477:19: error: dereferencing pointer to incomplete type
jni/newDecoder/ffmpeg/libavutil/parseutils.c:483:19: error: dereferencing pointer to incomplete type
jni/newDecoder/ffmpeg/libavutil/parseutils.c:489:19: error: dereferencing pointer to incomplete type
jni/newDecoder/ffmpeg/libavutil/parseutils.c:495:19: error: dereferencing pointer to incomplete type



=====================

=====================

=====================

=====================

=====================

=====================

=====================

=====================

error:



***

Answer:

6.1、error: libavcodec/codec_names.h: No such file or directory

源文档 http://bbs.rosoo.net/thread-13749-1-1.html

在ffmpeg目录下运行

cat libavcodec/avcodec.h | libavcodec/codec_names.sh config.h libavcodec/codec_names.h

=====================

编译10分钟左右,最后编译成功的log

Install        : libAndroidCamera.so => libs/armeabi/libAndroidCamera.so


=====================

error:

***

Answer:

=====================



这篇关于ndk 编译常见错误-你懂得的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/430231

相关文章

python常见环境管理工具超全解析

《python常见环境管理工具超全解析》在Python开发中,管理多个项目及其依赖项通常是一个挑战,下面:本文主要介绍python常见环境管理工具的相关资料,文中通过代码介绍的非常详细,需要的朋友... 目录1. conda2. pip3. uvuv 工具自动创建和管理环境的特点4. setup.py5.

SpringBoot排查和解决JSON解析错误(400 Bad Request)的方法

《SpringBoot排查和解决JSON解析错误(400BadRequest)的方法》在开发SpringBootRESTfulAPI时,客户端与服务端的数据交互通常使用JSON格式,然而,JSON... 目录问题背景1. 问题描述2. 错误分析解决方案1. 手动重新输入jsON2. 使用工具清理JSON3.

java中long的一些常见用法

《java中long的一些常见用法》在Java中,long是一种基本数据类型,用于表示长整型数值,接下来通过本文给大家介绍java中long的一些常见用法,感兴趣的朋友一起看看吧... 在Java中,long是一种基本数据类型,用于表示长整型数值。它的取值范围比int更大,从-922337203685477

详解Linux中常见环境变量的特点与设置

《详解Linux中常见环境变量的特点与设置》环境变量是操作系统和用户设置的一些动态键值对,为运行的程序提供配置信息,理解环境变量对于系统管理、软件开发都很重要,下面小编就为大家详细介绍一下吧... 目录前言一、环境变量的概念二、常见的环境变量三、环境变量特点及其相关指令3.1 环境变量的全局性3.2、环境变

Java中常见队列举例详解(非线程安全)

《Java中常见队列举例详解(非线程安全)》队列用于模拟队列这种数据结构,队列通常是指先进先出的容器,:本文主要介绍Java中常见队列(非线程安全)的相关资料,文中通过代码介绍的非常详细,需要的朋... 目录一.队列定义 二.常见接口 三.常见实现类3.1 ArrayDeque3.1.1 实现原理3.1.2

MyBatis设计SQL返回布尔值(Boolean)的常见方法

《MyBatis设计SQL返回布尔值(Boolean)的常见方法》这篇文章主要为大家详细介绍了MyBatis设计SQL返回布尔值(Boolean)的几种常见方法,文中的示例代码讲解详细,感兴趣的小伙伴... 目录方案一:使用COUNT查询存在性(推荐)方案二:条件表达式直接返回布尔方案三:存在性检查(EXI

如何解决Druid线程池Cause:java.sql.SQLRecoverableException:IO错误:Socket read timed out的问题

《如何解决Druid线程池Cause:java.sql.SQLRecoverableException:IO错误:Socketreadtimedout的问题》:本文主要介绍解决Druid线程... 目录异常信息触发场景找到版本发布更新的说明从版本更新信息可以看到该默认逻辑已经去除总结异常信息触发场景复

Python struct.unpack() 用法及常见错误详解

《Pythonstruct.unpack()用法及常见错误详解》struct.unpack()是Python中用于将二进制数据(字节序列)解析为Python数据类型的函数,通常与struct.pa... 目录一、函数语法二、格式字符串详解三、使用示例示例 1:解析整数和浮点数示例 2:解析字符串示例 3:解

CentOS 7 YUM源配置错误的解决方法

《CentOS7YUM源配置错误的解决方法》在使用虚拟机安装CentOS7系统时,我们可能会遇到YUM源配置错误的问题,导致无法正常下载软件包,为了解决这个问题,我们可以替换YUM源... 目录一、备份原有的 YUM 源配置文件二、选择并配置新的 YUM 源三、清理旧的缓存并重建新的缓存四、验证 YUM 源

MySQL查看表的最后一个ID的常见方法

《MySQL查看表的最后一个ID的常见方法》在使用MySQL数据库时,我们经常会遇到需要查看表中最后一个id值的场景,无论是为了调试、数据分析还是其他用途,了解如何快速获取最后一个id都是非常实用的技... 目录背景介绍方法一:使用MAX()函数示例代码解释适用场景方法二:按id降序排序并取第一条示例代码解