[FFmpeg-cvslog] doc/platform: Replace Visual Studio section with build instructions
Derek Buitenhuis
git at videolan.org
Fri Sep 28 22:40:56 CEST 2012
ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Thu Sep 27 18:39:02 2012 +0000| [f8241055c7c3600f14929343ec4bf6b2c859ab2e] | committer: Derek Buitenhuis
doc/platform: Replace Visual Studio section with build instructions
Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8241055c7c3600f14929343ec4bf6b2c859ab2e
---
doc/platform.texi | 81 ++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 68 insertions(+), 13 deletions(-)
diff --git a/doc/platform.texi b/doc/platform.texi
index 5d74a17..a518536 100644
--- a/doc/platform.texi
+++ b/doc/platform.texi
@@ -80,7 +80,7 @@ To get help and instructions for building FFmpeg under Windows, check out
the FFmpeg Windows Help Forum at
@url{http://ffmpeg.arrozcru.org/}.
- at section Native Windows compilation
+ at section Native Windows compilation using MinGW or MinGW-w64
FFmpeg 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
@@ -107,21 +107,76 @@ libavformat) as DLLs.
@end itemize
- at section Microsoft Visual C++ compatibility
+ at section Microsoft Visual C++
-As stated in the FAQ, FFmpeg 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.
+FFmpeg 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 FFmpeg 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
+make install
+ at end example
+
+Notes:
+
+ 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 FFmpeg is built as well.
+ at item Edit @code{zconf.h} and remove its inclusion of @code{unistd.h}. This gets
+erroneously included when building FFmpeg.
+ 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 FFmpeg 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 ffmpeg-cvslog
mailing list