[FFmpeg-devel] Problem with cross compilation / need guidance for patch submission

Diego Biurrun diego
Sun Oct 12 18:49:37 CEST 2008


On Sun, Oct 12, 2008 at 04:14:55PM +0000, Edouard Gomez wrote:
> 
> I narrowed the problem down to the -std=c99 flag that is now used during ffmpeg
> compilation.
> 
> The following commands show what the problem is:
> A simple test like this prove my sayings:
> $ touch blah.c
> $ i386-mingw32-gcc -dM -E blah.c | grep WIN32
> #define _WIN32 1
> #define __WIN32 1
> #define __WIN32__ 1
> #define WIN32 1
> $ i386-mingw32-gcc -std=c99 -dM -E blah.c | grep WIN32
> #define _WIN32 1
> #define __WIN32 1
> #define __WIN32__ 1
> 
> As you see gcc is following the C99 standard by forcing all
> system defines being prefixed by at least one underscore.
> 
> Couple that with the fact that faac.h has this kind of code:
> #ifdef WIN32
> # ifndef FAACAPI
> #  define FAACAPI __stdcall
> # endif
> #else
> # ifndef FAACAPI
> #  define FAACAPI
> # endif
> #endif
> 
> And you get a win32 cross compiled libavcodec that has deps on unknown symbols
> because faac is compiled with WIN32 defined.

The problem really is in FAAC and should be fixed there.  Submit a patch
to them that changes the preprocessor condition to use __WIN32__ or one
of the other variants.

In the meantime you can work around this problem by patching your local
FAAC headers.

Diego




More information about the ffmpeg-devel mailing list