[Ffmpeg-devel] Compilation poblem and fix on 2007-03-06 trunk

Måns Rullgård mans
Thu Mar 8 11:43:18 CET 2007

Tatu Kilappa said:
> I noticed a slight problem in the compilation of today's ffmpeg on C++
> programs. Since C99 integer constant macros are not enabled by default,
> including avcodec.h will cause compilation to fail with a report
> to a missing identifier INT64_C.
> grepping through /usr/include it becomes obvious that INT64_C is only
> defined within stdint.h, which is not specifically included at any
> point in libavcodec sources. My proposal for the fix would be following:

We #include <inttypes.h>, which is required to include stdint.h.

> 1) Add a check for stdint.h in configure.

Pointless.  We require it.

> 2) Before including anything else in avcodec.h, include stdint.h with
> __STDC_CONSTANT_MACROS enabled so as to ensure that they're defined no
> matter what.
> The patches included here accomplish that.

FFmpeg and its libraries are written in C, and can be built and used in a
conforming C environment.  If you want to use it from another language, you
must take whatever steps are needed to access C libraries from that language.

In the case of C++, this apparently includes defining the macro you mention.
Other languages, e.g. Fortran, have different requirements entirely.

Furthermore, your patch does the wrong thing, and doesn't even do that right.
The config.h macros are only available when building FFmpeg and must not be
used in the public headers.

Patch rejected.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list