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

编译环境 Apple M1 Pro Sonoma 14.1.2
编译的时候出现如下报错:

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 这个文件

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" # 加上这个就能编译过了

接下来就没问题了。

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xyccstudio

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值