undefined reference to `x264_encoder_open_125'

2019-04-07 04:37发布

While installing ffmpeg on Ubuntu 12.04

I am getting following error

libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/root/ffmpeg/libavcodec/libx264.c:492: undefined reference to `x264_encoder_open_125'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

I am following the instructions given at http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide

Do anyone have idea about this error?

2条回答
三岁会撩人
2楼-- · 2019-04-07 04:48

add the header and lib path

gcc x264_test1.c -o x264_encoder -I/usr/local/include -L/usr/local/lib -lpthread -lm -lx264

查看更多
Summer. ? 凉城
3楼-- · 2019-04-07 05:00

This is a typical problem for people who already have x264 installed through the package management system. You can solve this in at least 2 ways:

  1. Uninstall the already existing x264 from your system, through the package management system:

    # apt-get remove x264
    

    and compile your new x264 from source

  2. Don't uninstall the x264 package, but compile your new x264 and then compile your ffmpeg, telling it to use that newly compiled x264 library, by specifying that directory where your compiled x264 library is, using the mentioned LD_LIBRARY_PATH environment variable:

    LD_LIBRARY_PATH=/path/to/my/compiled/x264/library ./configure --enable-libx264 ...
    

More info can be found on these links:

查看更多
登录 后发表回答