Originally Posted by OKComputerQ
sudo apt-get purge ffmpeg
and then attempt to build x264 again. I have a feeling that there may have been a copy of FFmpeg 0.6 installed previously, and the 'remove' step didn't flush all of it out. Also, if any part of a make process fails, it tends to be a good idea to run 'make distclean' before running ./configure again. Otherwise you could get remnants from previous failed build attempts.
From a different angle, I would hope I'm wrong, but it could be due to the 'bulk' of the FFmpeg build that x264 is trying to link against. Some git commits from this past April mention an opt.h, but I don't know if it's related to this issue. You could try to build a stripped-down version of FFmpeg *first*, then build x264 (which will detect FFmpeg), then uninstall FFmpeg and install a proper, full version. For cleanliness reasons, you can install the minimal FFmpeg to a custom area, which won't mess with the system.
This is what I do since none of the encoders or muxers in FFmpeg are necessary for x264's lavf support to function (along with inflating FFMS2 the same way, and needing to link even more stuff in the process).
If you want to try the minimal FFmpeg->x264->full FFmpeg option, then see if this works:
FFMS2 (as optional as the lavf support in x264 is, and I think the sudo part covers everything needed):
./configure --prefix=$HOME/ffms2_build --enable-gpl --enable-version3 \
--enable-postproc --disable-encoders --disable-muxers --disable-debug \
--disable-network --disable-hwaccels --disable-indevs --disable-outdevs
x264 (which is just changes to the ./configure step):
sudo apt-get install subversion automake autoconf libtool
svn checkout http://ffmpegsource.googlecode.com/svn/trunk ffms2
./configure --prefix=$HOME/ffms2_build PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig
Cleanup before building full FFmpeg:
PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig ./configure --enable-static \