Problem during compilng program which is using ffmpeg libraries

Hi everybody.
I've got to write a program which will use ffmpeg libriries on Ubuntu. I've installed ffmpeg,i can now play convert etc audio & video files,but when i try to compile my source code it gets a lot of similar errors like

undefined reference to method_name


then i looked through info in the web & found out that i should have added some extra code before include

extern "C"{}

but this didn't helped,can anyone help me with this??
extern c is used for including the c header files.

undefined reference will normally occur during linking of function calls.
Have you added the ffmpeg library for linking ( using -l flag ), if you not, all your ffmpeg library calls will give you undefined reference.

hope this helps


yes i'm compiling with

-L usr/local/lib  -I usr/local/include 


but there are a lot of undefined reference errors
It will work only if your ffmpeg library is installed in /usr/local/lib directory.

If it not then add the folder where ffmpeg library has been build or installed to your -L flag.



i did so because it's installed there!but errors still remain.may be i got wrong somewhere(?
Topic archived. No new replies allowed.