I am trying to run a program that uses ffmpeg libraries to decode an mp3 file. I use the following options to compile the program:
g++ -c play.cpp -o play.o g++ -o play play.o -L/usr/local/lib -lavutil -lavcodec -lavformat -lavdevice \ -lavfilter -ldl -lasound -L/usr/lib -lSDL -lpthread -lz -lswscale -lm
But when binding, I get the following errors:
play.cpp:(.text+0x49): undefined reference to `av_dup_packet(AVPacket*)' play.cpp:(.text+0x66): undefined reference to `av_malloc(unsigned int)' play.cpp:(.text+0x324): undefined reference to `avcodec_decode_audio3(AVCodecContext*, short*, int*, AVPacket*)' play.cpp:(.text+0x387): undefined reference to `av_free_packet(AVPacket*)'
and so on ... These reported functions are available in libavcodec.a, etc., which I have already indicated with link parameters. Can someone please tell me what might be wrong here, or suggest how to approach debugging?
Sun
source share