[Libav-user] undefined reference to avformat_write_header

Sabine Bachmayer sabine.bachmayer at jku.at
Mon Aug 1 13:56:50 CEST 2011


I'm using the libraries of ffmpeg 0.7.1 in ubuntu 10.10. 
All in all, the libraries work great in Eclipse CDT (using C++) but I
have problems using avformat_write_headers(AVFormatContext*,
AVDictionary**) instead of the deprecated function av_write_header. I
always get the following error during compilation:
undefined reference to `avformat_write_header' C/C++ Problem

The weird thing is, that I'm able to use other functions that are
declared in libavformat/avformat.h and implemented in
libavformat/utils.c - for example av_guess_format(...) and
av_set_parameters(...), etc.

There seems to be no mistakes in the usage of avformat_write_headers
which is the following:
where pFormatCtx is of type AVFormatContext* including a previously
opened mpeg file.

I checked the include paths for C++ and C compilers as well as the
include libraries and library search path for the linker. 

I also tried to include libavformat/utils.c directly, but in this case I
get 44 compiler errors in utils.c which is weird as well because I
already compiled ffmpeg successfully by using its makefile.

Any idea where the mistake could be?

Thank you very much for your help!

Kind regards,

Filtered-With-Copfilter: Version 0.85.2 (ProxSMTP 1.8)
by Markus Madlener @ http://www.copfilter.org

More information about the Libav-user mailing list