VLC libx264 build error – “undefined reference to 'x264_encoder_open_128'”-Collection of common programming errors

Steps to attempt to repeat this error.

  • Download latest git (git://git.videolan.org/x264.git).
  • Run ./configure – You can use any options, the error is present with all.
  • Run sudo make – It will compile all of the code but when it comes time to link the code it runs into the error

    /usr/local/lib/libavcodec.a(libx264.o): In function ‘X264_init’:
    /…/libx264.c:418: undefined reference to ‘x264_encoder_open_128’

This will then fall out and exit make. I have removed all apt packages relating to x264. I have searched my computer for any possible libraries that might be related and removed them. This problem persists. Can someone explain what is going wrong and the simplest way to solve this?

Additional info

This error also shows up when building avconv. It also fails at linking time with the same error. So I can assume it is nothing wrong with that directory or source.