ndk编译ffmpeg 4.1版本 error: request for member 's_addr' in something not a st
hi@hi:~/3tb_volume/ffmpeg/ffmpeg-4.1$ which ndk-build
/home/hi/Android/Sdk/ndk-bundle/ndk-build
hi@hi:~/3tb_volume/ffmpeg/ffmpeg-4.1$ ndk-build -version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
1.使用Android Studio默认下载的ndk编译ffmpeg4.1
export NDK=/home/hi/Android/Sdk/ndk-bundle
提示错误如下
hi@hi:~/3tb_volume/ffmpeg/ffmpeg-4.1$ ./build2.sh
/home/hi/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
注:使用android-ndk-r16b也报同样的错误,也就是说新版本会报这个错误
2.ndk替换为android-ndk-r10e版本和android-ndk-r14b
export NDK=/home/hi/bin/android-ndk-r10e
不再报错:
hi@hi:~/3tb_volume/ffmpeg/ffmpeg-4.1$ ./build2.sh
install prefix ../fflib
source path .
C compiler /home/hi/bin/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
C library bionic
host C compiler gcc
host C library glibc
ARCH c (armv7-a)
big-endian no
runtime cpu detection yes
debug symbols no
strip symbols no
optimize for size yes
...
Enabled outdevs:
fbdev v4l2
License: GPL version 2 or later
WARNING: /home/hi/bin/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-pkg-config not found, library detection may fail.
libavutil/avconfig.h is unchanged
libavcodec/codec_list.c is unchanged
libavcodec/parser_list.c is unchanged
libavcodec/bsf_list.c is unchanged
libavformat/demuxer_list.c is unchanged
libavformat/muxer_list.c is unchanged
libavformat/protocol_list.c is unchanged
hi@hi:~/3tb_volume/ffmpeg/ffmpeg-4.1$
3.执行make,还是会报错:
CC libavformat/udp.o
libavformat/udp.c: In function 'udp_set_multicast_sources':
libavformat/udp.c:290:28: error: request for member 's_addr' in something not a structure or union
mreqs.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
^
compilation terminated due to -Wfatal-errors.
make: *** [libavformat/udp.o] 错误 1
有大神知道怎么解决吗?