The compiler errors I keep getting are:

error: ‘CODEC_ID_HUFFYUV’ undeclared (first use in this function)
     if (!codec) codec = avcodec_find_encoder(CODEC_ID_HUFFYUV);
error:‘PIX_FMT_YUV422P’ undeclared (first use in this function)
     c->pix_fmt = PIX_FMT_YUV422P;
error: ‘PIX_FMT_YUV420P’ undeclared (first use in this function)
     c->pix_fmt = PIX_FMT_YUV420P;
error: ‘CODEC_ID_FFV1’ undeclared (first use in this function)
     if (c->codec_id == CODEC_ID_FFV1)
error: ‘PIX_FMT_RGB24’

Which seem to be libav specific. I have ffmpeg installed, and have appropriate pkgconfig files at:


I don't understand what's going on.

Edit - More info:

The errors stem from a single source file which has

# include <inttypes.h>
#  include <libavcodec/avcodec.h>
# else
#  include <avcodec.h>
# endif
#  include <libavformat/avformat.h>
# else
#  include <avformat.h>
# endif
  • 1
    Whenever a build process complains about undeclared constants but doesn't complain about not finding header files, my first thought is an API mismatch i.e. the source code is expecting a different version of the headers/libs – steeldriver Mar 10 '16 at 13:02
  • That was along my reasoning also. I added some extra info that might help. How do I test to see which -D flags are being passed? Or which <libblah> libraries I have installed? – tetris11 Mar 10 '16 at 13:27
  • 1
    You should be able to get development version information using for example pkg-config --modversion libavcodec – steeldriver Mar 10 '16 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.