[Libav-user] undefined reference to avformat_write_header

Sabine Bachmayer sabine.bachmayer at jku.at
Mon Aug 1 15:28:17 CEST 2011


Hi!

Thank you for your quick reply!
Yes, the libav includes are all in the extern C wrap.

I have no problems with using other libav functions like register_all(),
av_open_input_file, av_find_stream_info, and other. 
Its only avformat_write_header that makes problems.

Kind regards,
Sabine 

On Mon, 2011-08-01 at 09:12 -0400, Matthew Einhorn wrote:
> On Mon, Aug 1, 2011 at 7:56 AM, Sabine Bachmayer
> <sabine.bachmayer at jku.at> wrote:
> > Hi!
> >
> > 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:
> > avformat_write_header(pFormatCtx,NULL);
> > 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?
> >
> 
> You did remember to wrap the include declarations with extern c?
> 
> > Thank you very much for your help!
> >
> > Kind regards,
> > Sabine
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > Filtered-With-Copfilter: Version 0.85.2 (ProxSMTP 1.8)
> > by Markus Madlener @ http://www.copfilter.org
> > _______________________________________________
> > Libav-user mailing list
> > Libav-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/libav-user
> >
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

-- 
-------------------------------------------------
Dipl. Ing. Sabine Bachmayer
Department of Telecooperation
Johannes Kepler University Linz
Altenberger Straße 69, 4040 Linz
Austria
Phone: +43 732 2468-9264 
Fax: +43 732 2468-9829

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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