Building ffmpeg with x264 on Windows

Questions that occur when trying to compile FFmpeg.
Post Reply
ffmpegsux
Posts: 12
Joined: Thu Dec 08, 2011 4:15 pm

Building ffmpeg with x264 on Windows

Post by ffmpegsux » Thu Dec 08, 2011 4:27 pm

I'm trying to build ffmpeg version 0.8.7 (static lib) with x264 and I got this:

c:/progra~1/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lx264
collect2: ld returned 1 exit status
ERROR: libx264 not found

Note: the x264 library has been built successfully.

Also, here is the config command line:

./configure --extra-cflags="-mno-cygwin -mms-bitfields" --extra-ldflags="-Wl,--add-stdcall-alias" --target-os=mingw32 --enable-static --disable-shared --disable-ffserver --enable-memalign-hack --enable-decoder=mpeg4 --enable-decoder=h264 --enable-decoder=png --disable-debug --enable-w32threads --disable-ffprobe --disable-ffplay --disable-ffmpeg --enable-libx264 --extra-cflags=-I/home/blabla/x264 --enable-gpl --extra-libs=/home/blabla/x264/libx264.a

Now, is someone could enlight me and explain why the hell is --extra-libs switch ignored??

ffmpegsux
Posts: 12
Joined: Thu Dec 08, 2011 4:15 pm

Re: Building ffmpeg with x264 on Windows

Post by ffmpegsux » Fri Dec 09, 2011 8:23 am

Well, nobody is posting any commnets... here is what I figured out till now:

After one modification in configure script, here is the result from the config.log:

Code: Select all

gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -mno-cygwin -mms-bitfields -I/home/blabla/x264 -std=c99 -fno-common -fomit-frame-pointer -c -o /tmp/ffconf.wwhEQmjR.o /tmp/ffconf.fTdrPSRI.c
gcc -Wl,--add-stdcall-alias -L/home/blabla/x264 -Wl,--as-needed -o /tmp/ffconf.ETvKlawz.exe /tmp/ffconf.wwhEQmjR.o -lm -lpsapi /home/blabla/x264/libx264.a
C:/Installs/x264/x264-snapshot-20111206-2245/libx264.a(encoder.o):encoder.c:(.text+0xa): undefined reference to `mcount'
C:/Installs/x264/x264-snapshot-20111206-2245/libx264.a(encoder.o):encoder.c:(.text+0x2f5): undefined reference to `mcount'
C:/Installs/x264/x264-snapshot-20111206-2245/libx264.a(encoder.o):encoder.c:(.text+0x365): undefined reference to `mcount'
C:/Installs/x264/x264-snapshot-20111206-2245/libx264.a(encoder.o):encoder.c:(.text+0x6da): undefined reference to `mcount'
C:/Installs/x264/x264-snapshot-20111206-2245/libx264.a(encoder.o):encoder.c:(.text+0x879): undefined reference to `mcount'
C:/Installs/x264/x264-snapshot-20111206-2245/libx264.a(encoder.o):encoder.c:(.text+0x99d): more undefined references to `mcount' follow
collect2: ld returned 1 exit status
ERROR: libx264 not found
Although it seems like the libx264.a has been found, the ERROR: libx264 not found is still here

ffmpegsux
Posts: 12
Joined: Thu Dec 08, 2011 4:15 pm

Re: Building ffmpeg with x264 on Windows

Post by ffmpegsux » Fri Dec 09, 2011 12:21 pm

Solved.

ramiro
Posts: 157
Joined: Tue May 10, 2011 12:56 am

Re: Building ffmpeg with x264 on Windows

Post by ramiro » Sun Dec 18, 2011 5:08 pm

it is considered good practice to say how you solved your problem in an online forum. other people will get here from googling the same error you got and will want to know the solution.

bltcs
Posts: 4
Joined: Wed Nov 30, 2011 1:56 pm

Re: Building ffmpeg with x264 on Windows

Post by bltcs » Sun Dec 18, 2011 6:10 pm

I had this same problem. For me it turned out to be a problem with pthreads, so I just configured x264 with "--enable-win32thread". FFmpeg started picking it up after this.

Post Reply
'