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

相关文章

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. 窗口操作

Visual Studio 2022 编译C++20代码的图文步骤

《VisualStudio2022编译C++20代码的图文步骤》在VisualStudio中启用C++20import功能,需设置语言标准为ISOC++20,开启扫描源查找模块依赖及实验性标... 默认创建Visual Studio桌面控制台项目代码包含C++20的import方法。右键项目的属性:

ModelMapper基本使用和常见场景示例详解

《ModelMapper基本使用和常见场景示例详解》ModelMapper是Java对象映射库,支持自动映射、自定义规则、集合转换及高级配置(如匹配策略、转换器),可集成SpringBoot,减少样板... 目录1. 添加依赖2. 基本用法示例:简单对象映射3. 自定义映射规则4. 集合映射5. 高级配置匹

深度解析Python装饰器常见用法与进阶技巧

《深度解析Python装饰器常见用法与进阶技巧》Python装饰器(Decorator)是提升代码可读性与复用性的强大工具,本文将深入解析Python装饰器的原理,常见用法,进阶技巧与最佳实践,希望可... 目录装饰器的基本原理函数装饰器的常见用法带参数的装饰器类装饰器与方法装饰器装饰器的嵌套与组合进阶技巧