ijkplayer iOS编译问题之[-Wincompatible-function-pointer-types]

编译环境 Apple M1 Pro Sonoma 14.1.2

编译的时候出现如下报错:

bash 复制代码
libavcodec/aarch64/h264dsp_init_aarch64.c:84:38: error: incompatible function pointer types assigning to 'h264_weight_func' (aka 'void (*)(unsigned char *, long, int, int, int, int)') from 'void (uint8_t *, int, int, int, int, int)' (aka 'void (unsigned char *, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
        c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
                                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/aarch64/h264dsp_init_aarch64.c:85:38: error: incompatible function pointer types assigning to 'h264_weight_func' (aka 'void (*)(unsigned char *, long, int, int, int, int)') from 'void (uint8_t *, int, int, int, int, int)' (aka 'void (unsigned char *, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
        c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
                                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/aarch64/h264dsp_init_aarch64.c:86:38: error: incompatible function pointer types assigning to 'h264_weight_func' (aka 'void (*)(unsigned char *, long, int, int, int, int)') from 'void (uint8_t *, int, int, int, int, int)' (aka 'void (unsigned char *, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
        c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
                                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/aarch64/h264dsp_init_aarch64.c:88:40: error: incompatible function pointer types assigning to 'h264_biweight_func' (aka 'void (*)(unsigned char *, unsigned char *, long, int, int, int, int, int)') from 'void (uint8_t *, uint8_t *, int, int, int, int, int, int)' (aka 'void (unsigned char *, unsigned char *, int, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
        c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
                                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/aarch64/h264dsp_init_aarch64.c:89:40: error: incompatible function pointer types assigning to 'h264_biweight_func' (aka 'void (*)(unsigned char *, unsigned char *, long, int, int, int, int, int)') from 'void (uint8_t *, uint8_t *, int, int, int, int, int, int)' (aka 'void (unsigned char *, unsigned char *, int, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
        c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
                                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/aarch64/h264dsp_init_aarch64.c:90:40: error: incompatible function pointer types assigning to 'h264_biweight_func' (aka 'void (*)(unsigned char *, unsigned char *, long, int, int, int, int, int)') from 'void (uint8_t *, uint8_t *, int, int, int, int, int, int)' (aka 'void (unsigned char *, unsigned char *, int, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
        c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
                                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 errors generated.
make: *** [libavcodec/aarch64/h264dsp_init_aarch64.o] Error 1
make: *** Waiting for unfinished jobs....

搜了搜好像没找到相关编译问题的,但是还需要用这个东西,只能再研究一下日志了,发现每个错误都有一个 [-Wincompatible-function-pointer-types],感觉好像就跟这个有关系了,然后搜了搜尝试修改一下解决了问题。

修改方法如下

找到do-compile-ffmpeg.sh 这个文件

bash 复制代码
FFMPEG_CFLAGS=
FFMPEG_CFLAGS="$FFMPEG_CFLAGS -arch $FF_ARCH"
FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCRUN_OSVERSION"
FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FFMPEG_EXTRA_CFLAGS"
FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCODE_BITCODE"
FFMPEG_CFLAGS="$FFMPEG_CFLAGS -Wno-error=incompatible-function-pointer-types" # 加上这个就能编译过了

接下来就没问题了。

相关推荐
Jinkey2 小时前
FlutterBasic - GetBuilder、Obx、GetX<Controller>、GetxController 有啥区别
android·flutter·ios
Stark-C3 小时前
万物皆可Docker,在NAS上一键部署最新苹果MacOS 15系统
macos·docker·策略模式
Roc.Chang3 小时前
macos 使用 nvm 管理 node 并自定义安装目录
macos·node.js·nvm
三劫散仙7 小时前
Mac vscode 激活列编辑模式
macos
程序猿看视界8 小时前
如何在 UniApp 中实现 iOS 版本更新检测
ios·uniapp·版本更新
endingCode10 小时前
45.坑王驾到第九期:Mac安装typescript后tsc命令无效的问题
javascript·macos·typescript
dr李四维12 小时前
iOS构建版本以及Hbuilder打iOS的ipa包全流程
前端·笔记·ios·产品运营·产品经理·xcode
️ 邪神12 小时前
【Android、IOS、Flutter、鸿蒙、ReactNative 】自定义View
flutter·ios·鸿蒙·reactnative·anroid
soulteary12 小时前
突破内存限制:Mac Mini M2 服务器化实践指南
运维·服务器·redis·macos·arm·pika
小江村儿的文杰1 天前
XCode Build时遇到 .entitlements could not be opened 的问题
ide·macos·ue4·xcode