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

接下来就没问题了。

相关推荐
Java小白笔记5 小时前
Mac中安装homebrew
macos
HerayChen8 小时前
HbuildderX运行到手机或模拟器的Android App基座识别不到设备 mac
android·macos·智能手机
hairenjing11238 小时前
在 Android 手机上从SD 卡恢复数据的 6 个有效应用程序
android·人工智能·windows·macos·智能手机
DisonTangor10 小时前
苹果发布iOS 18.2首个公测版:Siri接入ChatGPT、iPhone 16拍照按钮有用了
ios·chatgpt·iphone
- 羊羊不超越 -10 小时前
App渠道来源追踪方案全面分析(iOS/Android/鸿蒙)
android·ios·harmonyos
小李飞刀李寻欢11 小时前
Mac电脑如何解压rar压缩包
macos·rar·解压
Java小白笔记11 小时前
Mac中禁用系统更新
macos
AndyFrank11 小时前
mac crontab 不能使用问题简记
linux·运维·macos
Mac新人11 小时前
一招解决Mac没有剪切板历史记录的问题
macos·mac
王拴柱11 小时前
Mac保护电池健康,延长电池使用寿命的好方法
macos·mac