[FFmpeg-cvslog] faq: explain dependency problems with static libs.

Nicolas George git at videolan.org
Fri Jul 20 11:45:20 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed Jul 11 12:01:19 2012 +0200| [b34ce5a26b41b8f94ef0cf226561252585f2071b] | committer: Nicolas George

faq: explain dependency problems with static libs.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b34ce5a26b41b8f94ef0cf226561252585f2071b
---

 doc/faq.texi |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/doc/faq.texi b/doc/faq.texi
index da44adb..d10faa1 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -383,6 +383,24 @@ Yes, as long as the code is optional and can easily and cleanly be placed
 under #if CONFIG_GPL without breaking anything. So, for example, a new codec
 or filter would be OK under GPL while a bug fix to LGPL code would not.
 
+ at section I'm using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.
+
+FFmpeg builds static libraries by default. In static libraries, dependencies
+are not handled. That has two consequences. First, you must specify the
+libraries in dependency order: @code{-lavdevice} must come before
+ at code{-lavformat}, @code{-lavutil} must come after everything else, etc.
+Second, external libraries that are used in FFmpeg have to be specified too.
+
+An easy way to get the full list of required libraries in dependency order
+is to use @code{pkg-config}.
+
+ at example
+  c99 -o program program.c $(pkg-config --cflags --libs libavformat libavcodec)
+ at end example
+
+See @file{doc/example/Makefile} and @file{doc/example/pc-uninstalled} for
+more details.
+
 @section I'm using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.
 
 FFmpeg is a pure C project, so to use the libraries within your C++ application



More information about the ffmpeg-cvslog mailing list