So I downloaded FFmpeg from svn. Compiled and installed into system. in /usr/local it created ./lib and ./include. one with includes and one with libs in form of *.a files.
I downloaded eclipse Helios for C++ and created new simple project. I included ffmpeg headers into my C++ file. in project properties in C/C++Build in settings I declared ffmpeg libs (Library search path was declared)
I wrote some simple code that calls functions from headers.
But for all ffmpeg functions I used it gave me errors of eclipse not seeing ffmpeg.
So I wonder - how to connect ffmpeg libs to my project (or may be there is any way to compile ffmpeg not into .a and it would work with .so)?
if the includes and libraries that you want are in
/usr/local/include
and/usr/local/lib
respectively, seems that you are covered with include and library paths (these directories are in the default search path usually).Verify that you didn't use
lib...
when specifying the library that you want to link to, this is prepended by default, e.g. to uselibabc.a
just specifyabc
in the library list of the project settings.If you are getting compile errors (not linker errors), make sure libav* folders reside in
/usr/local/include
and you include ffmpeg headers with their folder names.You have to define
/usr/local/include
as an include directory and not libav* folders inside. This is needed because ffmpeg headers themselves reference other headers this way.I had the same problem on my ubuntu 12.04 and I fixed it by compiling ffmpeg and x264 in this way: I removed the folders of ffmpeg and x264 and then typed this in the terminal:
and then
then
installing x264
installing libvpx
check if /etc/ld.so.conf contains the lines
/usr/lib
and/usr/local/lib
. if not then add them and save itthen run
installing ffmpeg
in your project you should include the headers in this way:
In eclipse you should add the ffmpeg libraries to your project: avutil, avformat, avcodec, m, z ... by going to project->properties->C/C++->Build->Settings->GCC C++-> Linker->Libraries
I hope this works for you
You need to link them with your code. Use -l and -L gcc command line parameters in your make file, or edit the properties for your Eclipse project (go to the project properties->C/C++->Build->Settings->GCC C++-> Linker->Libraries.