当前位置:网站首页>Clang compile link ffmpeg FAQ
Clang compile link ffmpeg FAQ
2022-07-07 15:41:00 【When can Xiaobai advance to success】
One 、 Problems encountered during compilation
1、 Command not found
error message :
./build_android.sh: line 18: --enable-shared: command not found ./build_android.sh: line 20: --disable-static: command not found ./build_android.sh: line 22: --disable-doc: command not found ./build_android.sh: line 24: --disable-ffmpeg: command not found ./build_android.sh: line 26: --disable-ffplay: command not found ./build_android.sh: line 28: --disable-ffprobe: command not found ./build_android.sh: line 30: --disable-ffserver: command not found ./build_android.sh: line 32: --disable-avdevice: command not found |
solve :
If it's direct copy Online shell Script , It could be dos Format , Please use dos2unix build_android.sh Change my , Delete the extra space ( This is very important dos2unix It's a tool , If not, please install it first :brew install dos2unix , It'll be over soon .
2、xmakefile File not generated
error message :
./android_config.sh: line 36: --enable-shared: command not found Makefile:2: ffbuild/config.mak: No such file or directory Makefile:40: /tools/Makefile: No such file or directory Makefile:41: /ffbuild/common.mak: No such file or directory Makefile:91: /libavutil/Makefile: No such file or directory Makefile:91: /ffbuild/library.mak: No such file or directory Makefile:93: /fftools/Makefile: No such file or directory Makefile:94: /doc/Makefile: No such file or directory Makefile:95: /doc/examples/Makefile: No such file or directory Makefile:160: /tests/Makefile: No such file or directory make: *** No rule to make target `/tests/Makefile'. Stop. Makefile:2: ffbuild/config.mak: No such file or directory Makefile:40: /tools/Makefile: No such file or directory Makefile:41: /ffbuild/common.mak: No such file or directory Makefile:91: /libavutil/Makefile: No such file or directory Makefile:91: /ffbuild/library.mak: No such file or directory Makefile:93: /fftools/Makefile: No such file or directory Makefile:94: /doc/Makefile: No such file or directory Makefile:95: /doc/examples/Makefile: No such file or directory Makefile:160: /tests/Makefile: No such file or directory |
solve :
perform ./configure --disable-x86asm
Generate config.mak file
3、arm-linux-androideabi-gcc is unable to create an executable file
error message :
/Users/aria/dev/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc is unable to create an executable file. |
reason :
Check ndk edition ,android The official from r18b
Start , Has been removed gcc See ndk r18b Revised content
solve :
Use clang Compile , For details, see :https://medium.com/@ilja.kosynkin/building-ffmpeg-4-0-for-android-with-clang-642e4911c31e
4、/android_config.sh:line32:xxxx No such file or directory
reason :.configure
The following commands cannot have comments
solve :
Which line of code to delete the comment
5、static declaration of 'xxx' follows non-static declaration
solve :
config.h Search for lrint、lrintf、round、roundf Wait for the right character , take 0 It is amended as follows 1
#define HAVE_LLRINT 1 #define HAVE_LLRINTF 1 #define HAVE_LRINT 1 #define HAVE_LRINTF 1 #define HAVE_ROUND 1 #define HAVE_ROUNDF 1 #define HAVE_CBRT 1 #define HAVE_CBRTF 1 #define HAVE_COPYSIGN 1 #define HAVE_TRUNC 1 #define HAVE_TRUNCF 1 #define HAVE_RINT 1 #define HAVE_HYPOT 1 #define HAVE_ERF 1 |
Or use it directly sed
To modify the config.h
file
sed -i -e 's/#define HAVE_LLRINT 0/#define HAVE_LLRINT 1/g' config.h sed -i -e 's/#define HAVE_LLRINTF 0/#define HAVE_LLRINTF 1/g' config.h sed -i -e 's/#define HAVE_LRINT 0/#define HAVE_LRINT 1/g' config.h sed -i -e 's/#define HAVE_LRINTF 0/#define HAVE_LRINTF 1/g' config.h sed -i -e 's/#define HAVE_ROUND 0/#define HAVE_ROUND 1/g' config.h sed -i -e 's/#define HAVE_ROUNDF 0/#define HAVE_ROUNDF 1/g' config.h sed -i -e 's/#define HAVE_CBRT 0/#define HAVE_CBRT 1/g' config.h sed -i -e 's/#define HAVE_CBRTF 0/#define HAVE_CBRTF 1/g' config.h sed -i -e 's/#define HAVE_COPYSIGN 0/#define HAVE_COPYSIGN 1/g' config.h sed -i -e 's/#define HAVE_TRUNC 0/#define HAVE_TRUNC 1/g' config.h sed -i -e 's/#define HAVE_TRUNCF 0/#define HAVE_TRUNCF 1/g' config.h sed -i -e 's/#define HAVE_RINT 0/#define HAVE_RINT 1/g' config.h sed -i -e 's/#define HAVE_HYPOT 0/#define HAVE_HYPOT 1/g' config.h sed -i -e 's/#define HAVE_ERF 0/#define HAVE_ERF 1/g' config.h sed -i -e 's/#define HAVE_GMTIME_R 0/#define HAVE_GMTIME_R 1/g' config.h sed -i -e 's/#define HAVE_LOCALTIME_R 0/#define HAVE_LOCALTIME_R 1/g' config.h sed -i -e 's/#define HAVE_INET_ATON 0/#define HAVE_INET_ATON 1/g' config.h |
6、xxxx error:expected ')'
error message :
#define getenv(x) NULL ^ /home/cd008/diska/android-ndk-r9/platforms/android-18/arch-arm/usr/include/stdlib.h:54:14: note: in expansion of macro 'getenv' extern char *getenv(const char *); ^ ./config.h:17:19: error: expected ')' before numeric constant #define getenv(x) NULL ^ /home/cd008/diska/android-ndk-r9/platforms/android-18/arch-arm/usr/include/stdlib.h:54:14: note: in expansion of macro 'getenv' extern char *getenv(const char *); |
solve :
stay config.h Note out #define getenv(x) NULL
/#define getenv(x) NULL/
sed -i -e 's/#define getenv(x) NULL/\/\*#define getenv(x) NULL\*\//g' config.h |
7、arm-linux-androideabi-ld -Wl,-soname,libavutil.so unknown option
error message :
Users/aria/dev/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld -Wl,-soname |
reason :
gcc structure .so
The order is -shared -wl,soname,xxxx.so
and clang Yes. -shared -soname xxx.so
solve :
modify ffbuild/config.mak
file , take SHFLAGS=-shared -Wl,-soname,$(SLIBNAME)
It is amended as follows SHFLAGS=-shared -soname $(SLIBNAME)
8、arm-linux-androideabi-ld:fatal error:-shared and -pie are incompatible
solve :
modify ffbuild/config.mak
file , take LDEXEFLAGS= -fPIE -pie
Get rid of -pie
9、member at 2760 is not an ELF object
reason 1: Not used ndk Band ar To pack
solve : Check ar
Whether the path of the command is correct
reason 2: macos ranlib and ndk Of ranlib Are not compatible
solve : see 3.8
10、the table of contents is empty(no object file memberss in the library define global symbols)
reason :
macos Of ranlib and ndk Of ranlib Are not compatible
solve :
Use ndk Self contained ranlib
ranlib=xxxx/arm-linux-androideabi-runlib |
11、undefined reference to '__aeabi_memcpy'
reason :
ld Merge multiple .a
Static library parameter error
solve :
take -static
Change it to -shared
12、undefined reference xxxx
reason :
ffmpeg Problems caused by inlining
solve :
There is no effective solution for the time being
summary
The most common problem in the compilation process is clang、ld、ar And other tools , When these errors occur , Various tools should be used --help
To check if the configuration is correct , Especially from gcc
Over to clang
,gcc and clang Many configurations of are different , Most tutorials on the Internet use gcc To compile the ffmpeg.
clang --help xxxxxx-ld --help xxxxxx-ar --help |
Two 、 Problems encountered in link execution
边栏推荐
- Oracle控制文件丢失恢复归档模式方法
- [quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
- 【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
- [server data recovery] data recovery case of raid failure of a Dell server
- Ctfshow, information collection: Web3
- 【目标检测】YOLOv5跑通VOC2007数据集
- 2. Basic knowledge of golang
- Cocos makes Scrollview to realize the effect of zooming in the middle and zooming out on both sides
- [quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)
- [data mining] visual pattern mining: hog feature + cosine similarity /k-means clustering
猜你喜欢
Window环境下配置Mongodb数据库
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
Steps to create P8 certificate and warehousing account
[deep learning] semantic segmentation experiment: UNET network /msrc2 dataset
webgl_ Enter the three-dimensional world (1)
简述keepalived工作原理
Introduction of mongod management database method
[target detection] yolov5 Runtong voc2007 data set
【数字IC验证快速入门】25、SystemVerilog项目实践之AHB-SRAMC(5)(AHB 重点回顾,要点提炼)
随机推荐
【数字IC验证快速入门】26、SystemVerilog项目实践之AHB-SRAMC(6)(APB协议基本要点)
Ctfshow, information collection: web8
[quick start of Digital IC Verification] 23. AHB sramc of SystemVerilog project practice (3) (basic points of AHB protocol)
Configure mongodb database in window environment
PAT 甲级 1103 Integer Factorizatio
#HPDC智能基座人才发展峰会随笔
有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?
HPDC smart base Talent Development Summit essay
【兰州大学】考研初试复试资料分享
Gd32 F3 pin mapping problem SW interface cannot be burned
[quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)
什么是pv和uv? pv、uv
Pat grade a 1103 integer factorizatio
Ctfshow, information collection: web4
[understanding of opportunity -40]: direction, rules, choice, effort, fairness, cognition, ability, action, read the five layers of perception of 3GPP 6G white paper
Ctfshow, information collection: web6
Briefly describe the working principle of kept
Typescript release 4.8 beta
What is Base64?
Android -- jetpack: the difference between livedata setValue and postvalue