Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques error: static declaration of ‘lrint’ follows non-static declaration

  • error: static declaration of ‘lrint’ follows non-static declaration

    Posted by Gerry Reno on April 28, 2012 at 6:39 pm

    Under newer GCC > 4 you get these errors after configuring and compiling ffmpeg:
    $ make
    CC libavfilter/af_aconvert.o
    In file included from ./libavutil/internal.h:182,
    from ./libavutil/common.h:355,
    from ./libavutil/avutil.h:327,
    from ./libavutil/samplefmt.h:22,
    from ./libswresample/swresample.h:30,
    from libavfilter/af_aconvert.c:29:
    ./libavutil/libm.h:67: error: static declaration of 'lrint' follows non-static declaration
    ./libavutil/libm.h:74: error: static declaration of 'lrintf' follows non-static declaration
    ./libavutil/libm.h:81: error: static declaration of 'round' follows non-static declaration
    ./libavutil/libm.h:95: error: static declaration of 'trunc' follows non-static declaration
    make: *** [libavfilter/af_aconvert.o] Error 1

    So how do you build ffmpeg using newer GCC?

    Gerry Reno replied 14 years, 4 months ago 1 Member · 2 Replies
  • 2 Replies
  • Gerry Reno

    April 28, 2012 at 7:17 pm

    It looks like the problem might relate to math.h and tgmath.h.

    On some platforms lrint and friends are defined in math.h and on others they are defined in tgmath.h.

    So when ffmpeg includes a copy of math.h that contains lrint and friends then you get the redefinition error.

    What can we do though to get ffmpeg to build?

  • Gerry Reno

    April 28, 2012 at 8:40 pm

    Here’s a workaround:

    Edit config.h (yes, it's generated by configure) and set all lrint and friends to '1'.
    eg: #define HAVE_LRINT 1

    This will permit the build to continue.

    If you rerun 'configure' then you will need to do edit config.h again.

    What is happening is that when you have a host and target system that implement lrint and friends in different math headers that is when you run into the problem. The configure is not looking at the target system only the host system on cross-compiles. This is why macports android mipsel and others run into the problem.

    .

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy