[FFmpeg-devel] Fix libx264

Måns Rullgård mans
Wed Feb 3 18:11:06 CET 2010

Felipe Contreras <felipe.contreras at gmail.com> writes:

> Hi,
> I'm getting this error when trying to build with --enable-libx264:
> ---
> gcc -o /tmp/ffconf.Ln1pzlRv /tmp/ffconf.PTBRiOvi.o -lz -lbz2 -lm
> -lmp3lame -lm -lx264 -lm
> /opt/x264/lib/libx264.a(encoder.o): In function `x264_encoder_frame_end':
> encoder.c:(.text+0xe4a): undefined reference to `pthread_join'
> Apparently this only happens when libx264 is built statically. In any
> case, the solution is to add -lpthread.

No, the correct solution is to add the compiler-specific flags
required to link the thread library.  For gcc this is -pthread, note
no 'l', for other compilers it is often something else.

> But would we add other dependencies each time they change them?
> Wouldn't it be easier to just use pkg-config?

Because pkg-config is often simply wrong, especially when not using gcc.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list