Builing ffmpeg with libx264 enabled on cygwin

2020-07-26 04:00发布

问题:

I am trying to build ffmpeg (0.6.1 release) with libx264 for h.264 support on windows platform over cygwin environment.

I compiled x264-snapshot-20101228-2245 and installed the library in /usr/local/lib/(libx264.a). The configure option here (./configure --enable-shared --disable-asm )

Now I am trying to build ffmpeg with below configure option:

./configure --enable-shared --disable-static --enable-pthreads --enable-libx264 --enable-gpl --disable-doc --enable-memalign-hack --extra-ldflags=/usr/local/lib

But configure is giving error. shell: ERROR: libx264 not found

++++++++++++++++++++ config.err

gcc -o /tmp/ffconf.ww1dJh1K.exe /tmp/ffconf.X7919VWP.o -lpsapi -lz -lbz2 -lm -lx264 -lm
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lx264
collect2: ld returned 1 exit status
ERROR: libx264 not found
++++++++++++++++++++++

Tools Details Gcc version : gcc (GCC) 4.3.4 20090804 (release) 1

I will be glad if somebody points out the issue here.

回答1:

Try --extra-ldflags="-L /usr/local/lib". If that doesn't help, try LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ./configure ...



回答2:

Have you tried adding --enable-memalign-hack to the configure flags



回答3:

On Windows, you should use

--extra-ldflags=/LIBPATH:path_to_lib_file


标签: ffmpeg