I am trying to run a program which uses ffmpeg libraries to decode a mp3 file. I am using following options for compiling 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 while linking I am gettign 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 the libavcodec.a etc. which i have already specified with the link options. Can anyone please tell me what could be wrong here or suggest how to approach debugging this?