• 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....
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    搜了搜好像没找到相关编译问题的,但是还需要用这个东西,只能再研究一下日志了,发现每个错误都有一个 [-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" # 加上这个就能编译过了
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    接下来就没问题了。

  • 相关阅读:
    【云原生 | Kubernetes 系列】--Gitops持续交付和持续Tekton Triggers
    API网关之网关概述、技术选型
    JQuery UI——滑动条组件
    读高性能MySQL(第4版)笔记04_操作系统和硬件优化
    JVM虚拟机字节码执行引擎——类文件和类加载之前必看
    计算机组成与体系结构-进制转换
    27、Flink 的SQL之SELECT (SQL Hints 和 Joins)介绍及详细示例(2-2)
    LeetCode--230. 二叉搜索树中第K小的元素(C++描述)
    Linux 系统vim练习简单的 shell script
    2022年最新前端面试题,持续更新
  • 原文地址:https://blog.csdn.net/xo19882011/article/details/138162135