[FFmpeg-devel] Building C++ Application with ffmpeg SVN rev 9083

Clemens Fischer Clemens.Fischer
Tue May 22 17:07:30 CEST 2007


I have used ffmpeg SVN rev 5457 (static libraries) with my C++ 
Application for almost a year and thougth it might be a great idea to 
use the (almost) latest SVN revision (9083).
The first issue I came across was "INT64_C" which I could solve by 
adding "-D__STDC_CONSTANT_MACROS" to STDCCFLAGS so I can successfuly 
compile my C++ applications - but linking fails with undefined 
references to all ffmpeg functions  I use in my source code.

The libraries I link against are in place and using "nm" shows that 
these libraries are OK and exporting all the funtions my code references 
and using plain C I can use the libraries (find below a C and C++ test 
to reproduce my problem).

[test.c]
#include "avformat.h"

int main(int argc,char* argv[])
{
    av_register_all();
    return 0;   
}

 >> gcc test.c -I /usr/local/custom/ffmpeg/include/ffmpeg -L 
/usr/local/custom/ffmpeg/lib -lavformat -lavcodec -lavutil -o test
OK!!!

[test.cxx]
#include "avformat.h"

int main(int argc,char* argv[])
{
    av_register_all();
    return 0;   
}

 >> gcc test.cxx -D__STDC_CONSTANT_MACROS -I 
/usr/local/custom/ffmpeg/include/ffmpeg -L /usr/local/custom/ffmpeg/lib
 -lavformat -lavcodec -lavutil -lstdc++ -Wno-deprecated-declarations -o test
In file included from 
/usr/local/pgsp/dep/ffmpeg/include/ffmpeg/avformat.h:32,
                 from test.cxx:1:
/usr/local/pgsp/dep/ffmpeg/include/ffmpeg/avcodec.h:2475: warning: 
attribute ignored in declaration of ?struct ImgReSampleContext?
/usr/local/pgsp/dep/ffmpeg/include/ffmpeg/avcodec.h:2475: warning: 
attribute for ?struct ImgReSampleContext? must follow the ?struct? keyword
/tmp/ccSgxcj2.o: In function `main':
test.cxx:(.text+0x12): undefined reference to `av_register_all()'
collect2: ld returned 1 exit status
NOK!!!

Regards & thnx for help
Clemens




More information about the ffmpeg-devel mailing list