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

接下来就没问题了。

相关推荐
小白学大数据30 分钟前
Snapchat API 访问:Objective-C 实现示例
开发语言·macos·objective-c
救救孩子把9 小时前
mac中git操作账号的删除
git·macos
键盘敲没电9 小时前
【iOS】KVC
ios·objective-c·xcode
吾吾伊伊,野鸭惊啼9 小时前
2024最新!!!iOS高级面试题,全!(二)
ios
吾吾伊伊,野鸭惊啼9 小时前
2024最新!!!iOS高级面试题,全!(一)
ios
sysin.org10 小时前
VMware ESXi 8.0U3b macOS Unlocker & OEM BIOS 2.7 集成网卡驱动和 NVMe 驱动 (集成驱动版)
macos·esxi·bios·unlocker·oem·2.7
yanling202310 小时前
Parallels Desktop 20 for Mac中文版发布了?会哪些新功能
macos·虚拟机·pd
不会敲代码的VanGogh11 小时前
【iOS】——应用启动流程
macos·ios·objective-c·cocoa
sysin.org12 小时前
VMware ESXi 7.0U3q macOS Unlocker 集成驱动版更新 OEM BIOS 2.7 支持 Windows Server 2025
windows·macos·esxi·bios·oem·网卡驱动·nvme驱动
GEEKVIP13 小时前
恢复已删除文件的可行方法,如何恢复已删除的文件
macos·智能手机·电脑·笔记本电脑·cocoa·iphone·ipad