[FFmpeg-devel] [PATCH] Fix compilation of static libraries with pthreads in MingW32

Ramiro Polla ramiro.polla
Sun Sep 6 01:47:18 CEST 2009


On Mon, Aug 31, 2009 at 7:32 AM, Horacio Sanson<hsanson at gmail.com> wrote:
> FFMpeg static libraries fail to compile with the --enable-pthreads
> switch in a MingW32 environment. Before
> I used this patch
> "http://ffmpeg.arrozcru.org/wiki/images/d/dd/Ffmpeg_r15966_static_pthreads.diff"
> but it no
> longer applies to the latest SVN.
>
> I am no expert making make files and need some help to improve this line:
>
> -enabled libx264 ? ?&& require ?libx264 x264.h x264_encoder_open -lx264 -lm &&
> +enabled libx264 ? ?&& require2 libx264 "stdint.h x264.h"
> x264_encoder_open -lx264 -lpthreadGC2 -lws2_32 -lm &&
>
> I am pretty sure adding "-lpthreadGC2 -lws2_32" is not correct as
> pthreads depends on the configure flags but I do not
> know how the correct way to do this. Without these flags added after
> -lx264 I get unresolved symbol errors.

This has already been discussed in
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/67185

I now patch pthreads-win32 to automatically initialize itself. More
information here:
http://ffmpeg.arrozcru.org/autobuilds/blog/2009/07/17/pthreads-win32-updated-important/

It still requires a (simpler) patch for FFmpeg that can be found here:
http://ffmpeg.arrozcru.org/autobuilds/howto/static/

inside the latest packages under patches/ffmpeg-mingw32.diff

> Also I ran the regression tests and "asf" failed (see output below)
> but I think this has nothing to do with this changes.

I think you didn't understand how the regression tests work. The last line says:

[...]
> seek regression test: success

Ramiro Polla



More information about the ffmpeg-devel mailing list