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

相关文章

C++中初始化二维数组的几种常见方法

《C++中初始化二维数组的几种常见方法》本文详细介绍了在C++中初始化二维数组的不同方式,包括静态初始化、循环、全部为零、部分初始化、std::array和std::vector,以及std::vec... 目录1. 静态初始化2. 使用循环初始化3. 全部初始化为零4. 部分初始化5. 使用 std::a

前端下载文件时如何后端返回的文件流一些常见方法

《前端下载文件时如何后端返回的文件流一些常见方法》:本文主要介绍前端下载文件时如何后端返回的文件流一些常见方法,包括使用Blob和URL.createObjectURL创建下载链接,以及处理带有C... 目录1. 使用 Blob 和 URL.createObjectURL 创建下载链接例子:使用 Blob

C++ vector的常见用法超详细讲解

《C++vector的常见用法超详细讲解》:本文主要介绍C++vector的常见用法,包括C++中vector容器的定义、初始化方法、访问元素、常用函数及其时间复杂度,通过代码介绍的非常详细,... 目录1、vector的定义2、vector常用初始化方法1、使编程用花括号直接赋值2、使用圆括号赋值3、ve

Pytest多环境切换的常见方法介绍

《Pytest多环境切换的常见方法介绍》Pytest作为自动化测试的主力框架,如何实现本地、测试、预发、生产环境的灵活切换,本文总结了通过pytest框架实现自由环境切换的几种方法,大家可以根据需要进... 目录1.pytest-base-url2.hooks函数3.yml和fixture结论你是否也遇到过

idea maven编译报错Java heap space的解决方法

《ideamaven编译报错Javaheapspace的解决方法》这篇文章主要为大家详细介绍了ideamaven编译报错Javaheapspace的相关解决方法,文中的示例代码讲解详细,感兴趣的... 目录1.增加 Maven 编译的堆内存2. 增加 IntelliJ IDEA 的堆内存3. 优化 Mave

C/C++错误信息处理的常见方法及函数

《C/C++错误信息处理的常见方法及函数》C/C++是两种广泛使用的编程语言,特别是在系统编程、嵌入式开发以及高性能计算领域,:本文主要介绍C/C++错误信息处理的常见方法及函数,文中通过代码介绍... 目录前言1. errno 和 perror()示例:2. strerror()示例:3. perror(

Java编译生成多个.class文件的原理和作用

《Java编译生成多个.class文件的原理和作用》作为一名经验丰富的开发者,在Java项目中执行编译后,可能会发现一个.java源文件有时会产生多个.class文件,从技术实现层面详细剖析这一现象... 目录一、内部类机制与.class文件生成成员内部类(常规内部类)局部内部类(方法内部类)匿名内部类二、

Go标准库常见错误分析和解决办法

《Go标准库常见错误分析和解决办法》Go语言的标准库为开发者提供了丰富且高效的工具,涵盖了从网络编程到文件操作等各个方面,然而,标准库虽好,使用不当却可能适得其反,正所谓工欲善其事,必先利其器,本文将... 目录1. 使用了错误的time.Duration2. time.After导致的内存泄漏3. jsO

MyBatis 动态 SQL 优化之标签的实战与技巧(常见用法)

《MyBatis动态SQL优化之标签的实战与技巧(常见用法)》本文通过详细的示例和实际应用场景,介绍了如何有效利用这些标签来优化MyBatis配置,提升开发效率,确保SQL的高效执行和安全性,感... 目录动态SQL详解一、动态SQL的核心概念1.1 什么是动态SQL?1.2 动态SQL的优点1.3 动态S

Python中ModuleNotFoundError: No module named ‘timm’的错误解决

《Python中ModuleNotFoundError:Nomodulenamed‘timm’的错误解决》本文主要介绍了Python中ModuleNotFoundError:Nomodulen... 目录一、引言二、错误原因分析三、解决办法1.安装timm模块2. 检查python环境3. 解决安装路径问题