[libav-commits] doc/platform: Replace Visual Studio section with build instructions

Derek Buitenhuis git at libav.org
Fri Sep 28 21:52:22 CEST 2012

Module: libav
Branch: master
Commit: f45b54437a5f3ac28dc96f3b2551b4c602ec10e5

Author:    Derek Buitenhuis <derek.buitenhuis at gmail.com>
Committer: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Date:      Thu Sep 27 18:39:02 2012 +0000

doc/platform: Replace Visual Studio section with build instructions

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>


 doc/platform.texi |   81 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 68 insertions(+), 13 deletions(-)

diff --git a/doc/platform.texi b/doc/platform.texi
index ac4b871..a16bb46 100644
--- a/doc/platform.texi
+++ b/doc/platform.texi
@@ -75,7 +75,7 @@ For information about compiling Libav on OS/2 see
 @chapter Windows
- at section Native Windows compilation
+ at section Native Windows compilation using MinGW or MinGW-w64
 Libav can be built to run natively on Windows using the MinGW or MinGW-w64
 toolchains. Install the latest versions of MSYS and MinGW or MinGW-w64 from
@@ -101,21 +101,76 @@ you can build all libraries as DLLs.
 @end itemize
- at section Microsoft Visual C++ compatibility
+ at section Microsoft Visual C++
-As stated in the FAQ, Libav will not compile under MSVC++. However, if you
-want to use the libav* libraries in your own applications, you can still
-compile those applications using MSVC++. But the libav* libraries you link
-to @emph{must} be built with MinGW. However, you will not be able to debug
-inside the libav* libraries, since MSVC++ does not recognize the debug
-symbols generated by GCC.
-We strongly recommend you to move over from MSVC++ to MinGW tools.
+Libav can be built with MSVC using a C99-to-C89 conversion utility and
+wrapper. At this time, only static builds are supported.
-This description of how to use the Libav libraries with MSVC++ is based on
-Microsoft Visual C++ 2005 Express Edition. If you have a different version,
-you might have to modify the procedures slightly.
+You will need the following prerequisites:
- at subsection Using shared libraries
+ at itemize
+ at item @uref{https://github.com/rbultje/c99-to-c89/, C99-to-C89 Converter & Wrapper}
+ at item @uref{http://code.google.com/p/msinttypes/, msinttypes}
+ at item @uref{http://www.mingw.org/, MSYS}
+ at item @uref{http://yasm.tortall.net/, YASM}
+ at item @uref{http://gnuwin32.sourceforge.net/packages/bc.htm, bc for Windows} if
+you want to run @uref{fate.html, FATE}.
+ at end itemize
+To set up a proper MSVC environment in MSYS, you simply need to run
+ at code{msys.bat} from the Visual Studio command prompt.
+Caveat: Run @code{which link} to see which link you are using. If it is located
+at @code{/bin/link.exe}, then you have the wrong link in your @code{PATH}.
+Either move/remove that copy, or make sure MSVC's link.exe is higher up in your
+ at code{PATH} than coreutils'.
+Place @code{c99wrap.exe}, @code{c99conv.exe}, and @code{yasm.exe} somewhere
+in your @code{PATH}.
+Next, make sure @code{inttypes.h} and any other headers and libs you want to use
+are located in a spot that MSVC can see. Do so by modifying the @code{LIB} and
+ at code{INCLUDE} environment variables to include the @strong{Windows} paths to
+these directories. Alternatively, you can try and use the
+ at code{--extra-cflags}/@code{--extra-ldflags} configure options.
+Finally, run:
+ at example
+./configure --toolchain=msvc
+make install
+ at end example
+ at itemize
+ at item If you wish to build with zlib support, you will have to grab a compatible
+zlib binary from somewhere, with an MSVC import lib, or if you wish to link
+statically, you can follow the instructions below to build a compatible
+ at code{zlib.lib} with MSVC. Regardless of which method you use, you must still
+follow step 3, or compilation will fail.
+ at enumerate
+ at item Grab the @uref{http://zlib.net/, zlib sources}.
+ at item Edit @code{win32/Makefile.msc} so that it uses -MT instead of -MD, since
+this is how Libav is built as well.
+ at item Edit @code{zconf.h} and remove its inclusion of @code{unistd.h}. This gets
+erroneously included when building Libav.
+ at item Run @code{nmake -f win32/Makefile.msc}.
+ at item Move @code{zlib.lib}, @code{zconf.h}, and @code{zlib.h} to somewhere MSVC
+can see.
+ at end enumerate
+ at item Libav has been tested with Visual Studio 2010 and 2012, Pro and Express.
+Anything else is not officially supported.
+ at end itemize
+ at subsection Using shared libraries built with MinGW in Visual Studio
+Currently, if you want to build shared libraries on Windows, you need to
+use MinGW.
 This is how to create DLL and LIB files that are compatible with MSVC++:

More information about the libav-commits mailing list