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

相关文章

Go语言编译环境设置教程

《Go语言编译环境设置教程》Go语言支持高并发(goroutine)、自动垃圾回收,编译为跨平台二进制文件,云原生兼容且社区活跃,开发便捷,内置测试与vet工具辅助检测错误,依赖模块化管理,提升开发效... 目录Go语言优势下载 Go  配置编译环境配置 GOPROXYIDE 设置(VS Code)一些基本

Python错误AttributeError: 'NoneType' object has no attribute问题的彻底解决方法

《Python错误AttributeError:NoneTypeobjecthasnoattribute问题的彻底解决方法》在Python项目开发和调试过程中,经常会碰到这样一个异常信息... 目录问题背景与概述错误解读:AttributeError: 'NoneType' object has no at

MySQL深分页进行性能优化的常见方法

《MySQL深分页进行性能优化的常见方法》在Web应用中,分页查询是数据库操作中的常见需求,然而,在面对大型数据集时,深分页(deeppagination)却成为了性能优化的一个挑战,在本文中,我们将... 目录引言:深分页,真的只是“翻页慢”那么简单吗?一、背景介绍二、深分页的性能问题三、业务场景分析四、

java使用protobuf-maven-plugin的插件编译proto文件详解

《java使用protobuf-maven-plugin的插件编译proto文件详解》:本文主要介绍java使用protobuf-maven-plugin的插件编译proto文件,具有很好的参考价... 目录protobuf文件作为数据传输和存储的协议主要介绍在Java使用maven编译proto文件的插件

Java 方法重载Overload常见误区及注意事项

《Java方法重载Overload常见误区及注意事项》Java方法重载允许同一类中同名方法通过参数类型、数量、顺序差异实现功能扩展,提升代码灵活性,核心条件为参数列表不同,不涉及返回类型、访问修饰符... 目录Java 方法重载(Overload)详解一、方法重载的核心条件二、构成方法重载的具体情况三、不构

SQL中如何添加数据(常见方法及示例)

《SQL中如何添加数据(常见方法及示例)》SQL全称为StructuredQueryLanguage,是一种用于管理关系数据库的标准编程语言,下面给大家介绍SQL中如何添加数据,感兴趣的朋友一起看看吧... 目录在mysql中,有多种方法可以添加数据。以下是一些常见的方法及其示例。1. 使用INSERT I

Python中反转字符串的常见方法小结

《Python中反转字符串的常见方法小结》在Python中,字符串对象没有内置的反转方法,然而,在实际开发中,我们经常会遇到需要反转字符串的场景,比如处理回文字符串、文本加密等,因此,掌握如何在Pyt... 目录python中反转字符串的方法技术背景实现步骤1. 使用切片2. 使用 reversed() 函

SpringBoot+Docker+Graylog 如何让错误自动报警

《SpringBoot+Docker+Graylog如何让错误自动报警》SpringBoot默认使用SLF4J与Logback,支持多日志级别和配置方式,可输出到控制台、文件及远程服务器,集成ELK... 目录01 Spring Boot 默认日志框架解析02 Spring Boot 日志级别详解03 Sp

MySQL 中的 CAST 函数详解及常见用法

《MySQL中的CAST函数详解及常见用法》CAST函数是MySQL中用于数据类型转换的重要函数,它允许你将一个值从一种数据类型转换为另一种数据类型,本文给大家介绍MySQL中的CAST... 目录mysql 中的 CAST 函数详解一、基本语法二、支持的数据类型三、常见用法示例1. 字符串转数字2. 数字

Python中win32包的安装及常见用途介绍

《Python中win32包的安装及常见用途介绍》在Windows环境下,PythonWin32模块通常随Python安装包一起安装,:本文主要介绍Python中win32包的安装及常见用途的相关... 目录前言主要组件安装方法常见用途1. 操作Windows注册表2. 操作Windows服务3. 窗口操作