【问题标题】:Ffmpeg-Build: Error during buildFfmpeg-Build:构建期间出错
【发布时间】:2013-04-20 10:25:54
【问题描述】:

我正在构建 ffmpeg 并卡在一个不寻常的地方。在 libavutil 我们有 float_dsp.h 和 float_dsp.c 文件。在这些文件中,有一个方法声明:

void (*butterflies_float)(float *av_restrict v1, float *av_restrict v2, int len);
float (*scalarproduct_float)(const float *v1, const float *v2, int len);

在构建和编译此文件时,我收到此错误并且不知道该怎么做。我认为问题出在其他地方,但又完全不知道。错误是

jni/ffmpeg/libavcodec/../libavutil/float_dsp.h:150: error: expected ';', ',' or ')'  before 'v1'
jni/ffmpeg/libavcodec/../libavutil/float_dsp.h:161: error: expected ';' before 'float'

任何想要帮助的人请向前迈出一步,因为我在几周内还没有真正得到任何关于 ffmpeg 的支持。

问候

【问题讨论】:

    标签: android ffmpeg libavcodec libav


    【解决方案1】:

    这可能是由于:

    • 未将 GCC 设置为支持 restrict 关键字的 C99 模式
    • restrict 被一些#define 重新定义了
    • restrict 不支持特定架构,但这不太可能
    • GCC 设置为 C++ 模式,其中不支持 restrict 关键字的 GCC 根据http://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html

    GCC 还支持其他形式,例如 __restrict__restrict__。 ffmpeg 配置脚本将宏 av_restrict 设置为 restrict,可以在生成的 config.h 文件中检查。

    修复可能是更改配置检测代码并删除无效案例restrict

    --- ./configure.orig    2014-01-15 18:53:59.000000000 +0100
    +++ ./configure 2014-03-13 17:50:45.754442028 +0100
    @@ -3896,7 +3896,7 @@
     EOF
    
     _restrict=
    -for restrict_keyword in restrict __restrict__ __restrict; do
    +for restrict_keyword in __restrict__ __restrict; do
         check_cc <<EOF && _restrict=$restrict_keyword && break
     void foo(char * $restrict_keyword p);
     EOF
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-25
      • 1970-01-01
      • 2018-04-03
      • 2016-03-22
      • 1970-01-01
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      相关资源
      最近更新 更多