diff options
Diffstat (limited to 'doc/general.texi')
-rw-r--r-- | doc/general.texi | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/doc/general.texi b/doc/general.texi index f2f8ed4631..f44e57359c 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -970,7 +970,8 @@ make install Your install path (@file{/usr/local/} by default) should now have the necessary DLL and LIB files under the @file{bin} directory. -@end enumerate +Alternatively, build the libraries with a cross compiler, according to +the instructions below in @ref{Cross compilation for Windows with Linux}. To use those files with MSVC++, do the same as you would do with the static libraries, as described above. But in Step 4, @@ -983,10 +984,7 @@ libraries (@file{libxxx.a} files) you should add the MSVC import libraries libraries (@file{libxxx.dll.a} files), as these will give you undefined reference errors. There should be no need for @file{libmingwex.a}, @file{libgcc.a}, and @file{wsock32.lib}, nor any other external library -statically linked into the DLLs. The @file{bin} directory contains a bunch -of DLL files, but the ones that are actually used to run your application -are the ones with a major version number in their filenames -(i.e. @file{avcodec-51.dll}). +statically linked into the DLLs. FFmpeg headers do not declare global data for Windows DLLs through the usual dllexport/dllimport interface. Such data will be exported properly while @@ -999,10 +997,41 @@ extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[]; Note that using import libraries created by dlltool requires the linker optimization option to be set to -"References: Keep Unreferenced Data (/OPT:NOREF)", otherwise +"References: Keep Unreferenced Data (@code{/OPT:NOREF})", otherwise the resulting binaries will fail during runtime. This isn't required when using import libraries generated by lib.exe. +This issue is reported upstream at +@url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}. + +To create import libraries that work with the @code{/OPT:REF} option +(which is enabled by default in Release mode), follow these steps: + +@enumerate + +@item Open @file{Visual Studio 2005 Command Prompt}. + +Alternatively, in a normal command line prompt, call @file{vcvars32.bat} +which sets up the environment variables for the Visual C++ tools +(the standard location for this file is +@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat}). + +@item Enter the @file{bin} directory where the created LIB and DLL files +are stored. + +@item Generate new import libraries with @file{lib.exe}: + +@example +lib /machine:i386 /def:..\lib\avcodec-53.def /out:avcodec.lib +lib /machine:i386 /def:..\lib\avdevice-53.def /out:avdevice.lib +lib /machine:i386 /def:..\lib\avfilter-2.def /out:avfilter.lib +lib /machine:i386 /def:..\lib\avformat-53.def /out:avformat.lib +lib /machine:i386 /def:..\lib\avutil-51.def /out:avutil.lib +lib /machine:i386 /def:..\lib\swscale-2.def /out:swscale.lib +@end example + +@end enumerate +@anchor{Cross compilation for Windows with Linux} @subsection Cross compilation for Windows with Linux You must use the MinGW cross compilation tools available at |