How to compile VLC for Windows
Before you start
One common desire that leads people to want to rebuild VLC is to "rebuild a debug version" or "add printf()s", but this is not strictly necessary, as VLC includes a debug logging feature by default. If you are using a binary release (or have already built VLC), just run
'vlc.exe' and select "Messages..." from the "Tools" menu.
You can also run VLC from the Windows command-line interpreter,
cmd.exe (a.k.a. "DOS window"), in which case you'll be able to use the command-line arguments. You can obtain a list of these command line arguments by typing
'vlc --help' or
'vlc --help --advanced'.
To store a debug log of the current VLC session, you can use
'vlc -vvv --extraintf=logger'. You will end-up with a
vlc-log.txt file in your current directory.
Building VLC from source
If you want to build VLC from source, you have several choices:
|Cross-compile with Mingw32 on Linux||None: read this page||Preferred method (uses cross compilation) |
Note: read Win32CompileFedora13 if building on Fedora 13
|Native-compile with MSYS+MINGW||Win32CompileMSYSNew||Not recommanded native compilation method. MSYS is a minimal build environment to compile Unixish projects under Microsoft Windows. It provides all the commonly-required Unix tools (like sh, gmake, and so forth).|
Obtaining the build tools
Each build method requires its own toolchain:
|Cross-compile with mingw32 on GNU/Linux||
|Native-compile with MSYS+MINGW||Read the documentation|
|Native-compile with Cygwin||Read the documentation|
3rd party libraries.
VLC modules requires numerous open source projects to work (like AC3 audio decoding or MPEG-4 video decoding).
If you feel you must build these libraries from source, go to extras/contrib and read the README.
If you want to save yourself a lot of time and energy, use the pre-built versions of these libraries. You may download them from http://people.videolan.org/~jb/Contribs/, named in fashion of contrib-yyyymmdd-win32-version-bin-gcc-gccversion-only.tar.bz2.
Install the pre-built libraries into the standard directories (/usr/win32/*) by using
tar jxf contrib-20061122-win32-bin-gcc-3.4.5-only.tar.bz2 -C /
Configuring the build
First of all,
Once you've got all the files you need in place, you need to configure the build with the
Good examples can be found in some files (in git). From the vlc source base directory run:
extras/package/win32/configure.sh --with-contrib=/usr/win32 --host=i586-mingw32msvcfor cross compiling with mingw32
extras/package/win32/configure.sh --with-contrib=/path/to/folder/containing/contribsfor compiling with msys or cygwin
'./configure --help' for more information.
Once configured, to build VLC, just run
Once the compilation is done, you can either run VLC directly from the source tree or you can build self-contained VLC packages with the following
||Creates a subdirectory named |
||Same as above but will package the directory in a 7z file.|
||Same as above but will package the directory in a zip file.|
||Same as above but will also create an auto-installer package. You must have NSIS installed in its default location for this to work.|
Well done—you're ready to use VLC!