<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BonzaiThePenguin</id>
	<title>VideoLAN Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BonzaiThePenguin"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/BonzaiThePenguin/"/>
	<updated>2026-11-04T16:47:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Win32Compile&amp;diff=27267</id>
		<title>Win32Compile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Win32Compile&amp;diff=27267"/>
		<updated>2014-10-20T09:37:10Z</updated>

		<summary type="html">&lt;p&gt;BonzaiThePenguin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will help you to compile {{VLC}} for [[Windows]].&lt;br /&gt;
&lt;br /&gt;
== Building Methods ==&lt;br /&gt;
&lt;br /&gt;
If you want to build VLC from source, you have several choices: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method &lt;br /&gt;
! Documentation &lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MinGW on Linux&#039;&#039;&#039; &lt;br /&gt;
| [[Win32Compile#Obtaining_the_toolchain|Obtaining the toolchain]]&lt;br /&gt;
| &#039;&#039;&#039;Preferred&#039;&#039;&#039; method (uses cross compilation). On Windows, you should do it in a virtual machine.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[http://www.mingw.org MSYS+MinGW]&#039;&#039;&#039; on Windows&lt;br /&gt;
| [[Win32CompileMSYS|Compile with MSys]] &lt;br /&gt;
| &#039;&#039;&#039;Native&#039;&#039;&#039; compilation method. Note: This is not supported. MSYS is a minimal build environment to compile Unixish projects under Microsoft Windows. Good luck.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Cygwin&#039;&#039;&#039; on Windows&lt;br /&gt;
| [[Win32CompileCygwinNew|Compile with Cygwin]] &lt;br /&gt;
| Build using cygwin as your compile environment. &#039;&#039;&#039;Error&#039;&#039;&#039; prone, and &#039;&#039;&#039;slow&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Obtaining the cross-compilation toolchain  ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and binary toolchain ===&lt;br /&gt;
&lt;br /&gt;
==== Mingw-w64 ====&lt;br /&gt;
To compile VLC for Windows (32-bits or 64-bits), the Mingw-w64 toolchain is required:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Debian/Ubuntu&#039;&#039;&#039;: run &amp;lt;code&amp;gt;apt-get install gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools&amp;lt;/code&amp;gt;&lt;br /&gt;
For the 64-bit version, this becomes &amp;lt;code&amp;gt;apt-get install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64-tools&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(on Debian you must be on wheezy or above to find this package)&lt;br /&gt;
&lt;br /&gt;
You might want to use the following script to enforce static compilation.&lt;br /&gt;
Run as root, and use at your own risk.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # This script enforces statically linking of libgcc, libstdc++-6, and libpthread,&lt;br /&gt;
 # without needing to rebuild gcc and mingw-w64 from scratch.&lt;br /&gt;
 # -static-libgcc -static-libstdc++ flags can not be used in a libtool build system,&lt;br /&gt;
 # as libtool removes flags that it doesn&#039;t understand.&lt;br /&gt;
 &lt;br /&gt;
 move() {&lt;br /&gt;
     [ -f $1 ] || return 1&lt;br /&gt;
     mkdir -p old/&lt;br /&gt;
     mv -v $* old/&lt;br /&gt;
     return 0&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 for x in i686 x86_64&lt;br /&gt;
 do&lt;br /&gt;
     library_path_list=`$x-w64-mingw32-gcc -v /dev/null 2&amp;gt;&amp;amp;1 | grep ^LIBRARY_PATH|cut -d= -f2|sort|uniq`&lt;br /&gt;
     IFS=&#039;:&#039;&lt;br /&gt;
     for i in $library_path_list&lt;br /&gt;
     do&lt;br /&gt;
         cd $i&lt;br /&gt;
         move libstdc++-6.dll libstdc++.dll.a libgcc_s.a libgcc_s_sjlj-1.dll &amp;amp;&amp;amp; ln -s libgcc_eh.a libgcc_s.a&lt;br /&gt;
         move libpthread.dll.a libwinpthread.dll.a&lt;br /&gt;
         move libwinpthread-1.dll&lt;br /&gt;
         [ -d ../bin ] &amp;amp;&amp;amp; cd ../bin &amp;amp;&amp;amp; move libwinpthread-1.dll&lt;br /&gt;
     done&lt;br /&gt;
 done&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
==== Mingw32 ====&lt;br /&gt;
Up to versions 2.0.x, VLC was compiled with the older mingw32 toolchain, which only supports 32-bits Windows. If you have problems with mingw-w64, you can try mingw32 instead:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Debian/Ubuntu&#039;&#039;&#039;: run &amp;lt;code&amp;gt;apt-get install gcc-mingw32 mingw32-binutils&amp;lt;/code&amp;gt;. Note that at least version 3.17 of Mingw32 is required, which Debian does not provide. You may obtain mingw32-runtime-3.17 [http://people.videolan.org/~jb/debian/mingw32-runtime_3.17.0-0videolan_all.deb here].&lt;br /&gt;
* &#039;&#039;&#039;Gentoo&#039;&#039;&#039; users can &amp;lt;code&amp;gt;emerge crossdev &amp;amp;amp;&amp;amp;amp; crossdev mingw32&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;ArchLinux&#039;&#039;&#039; users can &amp;lt;code&amp;gt;pacman -S mingw32-gcc&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Fedora&#039;&#039;&#039; users should read [[Win32Compile Under Fedora]]&lt;br /&gt;
* Other &#039;&#039;&#039;Linux&#039;&#039;&#039; systems may attempt http://www.mingw.org/wiki/LinuxCrossMinGW&lt;br /&gt;
&lt;br /&gt;
=== Development tools ===&lt;br /&gt;
You will also need:&lt;br /&gt;
* lua (5.1 or 5.2)&lt;br /&gt;
* all autotools: libtool, automake, autoconf, autopoint, make, gettext&lt;br /&gt;
* pkg-config&lt;br /&gt;
* qt4-dev-tools, qt5-default&lt;br /&gt;
* git&lt;br /&gt;
* subversion&lt;br /&gt;
* cmake, cvs if you want to rebuild contribs&lt;br /&gt;
* wine-dev for creating Win32 packages&lt;br /&gt;
* zip [for creating .zip package], p7zip [for .7z package], nsis [for .exe auto-installer], bzip2 [for &#039;make prebuild]&lt;br /&gt;
&lt;br /&gt;
=== Host triplet ===&lt;br /&gt;
A number of example commands below include the identifier of the toolchain. This value is &#039;&#039;&#039;essential&#039;&#039;&#039;: it instructs the build system to use the correct toolchain and compile the program for Windows. Without the value, the build system will perform a native compilation for Linux (or whatever your computer runs). With an incorrect value, the build will fail.&lt;br /&gt;
&lt;br /&gt;
This is known as the &#039;&#039;host triplet&#039;&#039;, although it&#039;s more of a pair than a triplet in the case of Mingw. The exact value depends on your installation of the toolchain. Notably on Debian/Ubuntu, these values must be used:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;i686-w64-mingw32&#039;&#039; for Windows 32-bits, using the Mingw-w64 toolchain&lt;br /&gt;
* &#039;&#039;x86_64-w64-mingw32&#039;&#039; for Windows 64-bits, using the Mingw-w64 toolchain&lt;br /&gt;
* &#039;&#039;i586-mingw32msvc&#039;&#039; for Windows 32-bits, using the Mingw32 toolchain&lt;br /&gt;
&lt;br /&gt;
Again, you &#039;&#039;&#039;MUST&#039;&#039;&#039; substitute the value in the following command snippets.&lt;br /&gt;
&lt;br /&gt;
== Get the source code ==&lt;br /&gt;
 $ git clone git://git.videolan.org/vlc.git vlc&lt;br /&gt;
&lt;br /&gt;
See [[Git]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Go into the VLC directory ==&lt;br /&gt;
 $ cd vlc&lt;br /&gt;
&lt;br /&gt;
== Prepare [[Contrib Status|3rd party libraries]]  ==&lt;br /&gt;
&lt;br /&gt;
Before compiling VLC, you need lots of other libraries. Here is how to get them: &lt;br /&gt;
&lt;br /&gt;
  $ mkdir -p contrib/win32&lt;br /&gt;
  $ cd contrib/win32&lt;br /&gt;
  $ ../bootstrap --host=i686-w64-mingw32&lt;br /&gt;
  $ make prebuilt&lt;br /&gt;
&lt;br /&gt;
or, if you want to compile the contribs yourself and are feeling adventurous and have lots of time to burn,&lt;br /&gt;
  # apt-get install subversion yasm cvs cmake&lt;br /&gt;
&lt;br /&gt;
  $ mkdir -p contrib/win32&lt;br /&gt;
  $ cd contrib/win32&lt;br /&gt;
  $ ../bootstrap --host=i686-w64-mingw32&lt;br /&gt;
  $ make fetch&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
=== Linux 64-bit ===&lt;br /&gt;
&lt;br /&gt;
If you are on Linux &#039;&#039;&#039;64-bit&#039;&#039;&#039;, you &#039;&#039;&#039;SHOULD&#039;&#039;&#039; remove some files, or install the lib32 packages (ia32-libs, multilibs, etc...)&lt;br /&gt;
&lt;br /&gt;
  $ rm -f ../i686-w64-mingw32/bin/moc ../i686-w64-mingw32/bin/uic ../i686-w64-mingw32/bin/rcc&lt;br /&gt;
&lt;br /&gt;
=== Fix your contrib path ===&lt;br /&gt;
&lt;br /&gt;
If your Mingw prefix is not &#039;&#039;i686-w64-mingw32&#039;&#039; (you are NOT on Debian or Ubuntu), create a symlink to contribs:&lt;br /&gt;
  $ ln -sf ../i686-w64-mingw32 ../i486-mingw32&lt;br /&gt;
&lt;br /&gt;
=== Go Back  ===&lt;br /&gt;
&lt;br /&gt;
Go back to the VLC source directory: &lt;br /&gt;
&lt;br /&gt;
  $ cd -&lt;br /&gt;
&lt;br /&gt;
== Configuring the build  ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap ===&lt;br /&gt;
First, prepare the tree:&lt;br /&gt;
  $ ./bootstrap&lt;br /&gt;
&lt;br /&gt;
=== Configure ===&lt;br /&gt;
Then you can to configure the build with the &amp;lt;code&amp;gt;./configure&amp;lt;/code&amp;gt; script. &lt;br /&gt;
&lt;br /&gt;
Create a subfolder:&lt;br /&gt;
  $ mkdir win32 &amp;amp;&amp;amp; cd win32&lt;br /&gt;
&lt;br /&gt;
Set your PKG_CONFIG_LIBDIR&lt;br /&gt;
  $ export PKG_CONFIG_LIBDIR=$HOME/vlc/contrib/i686-w64-mingw32/lib/pkgconfig&lt;br /&gt;
&lt;br /&gt;
Use the standard configuration: &lt;br /&gt;
 $ ../extras/package/win32/configure.sh --host=i686-w64-mingw32&lt;br /&gt;
&#039;&#039;&#039;NB&#039;&#039;&#039;: use &#039;&#039;&#039;YOUR&#039;&#039;&#039; Xcompiling prefix here, like &#039;&#039;i486-mingw32&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can run configure manually:&lt;br /&gt;
 $ ../configure --host=i686-w64-mingw32&lt;br /&gt;
See &amp;lt;code&amp;gt;&#039;../configure --help&#039;&amp;lt;/code&amp;gt; for more information.&lt;br /&gt;
&lt;br /&gt;
== Building VLC  ==&lt;br /&gt;
&lt;br /&gt;
Once configured, to build VLC, just run:&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
== Packaging VLC ==&lt;br /&gt;
Once the compilation is done, you can build self-contained VLC packages with the following &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; rules: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command &lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;make package-win-common&amp;lt;/code&amp;gt;&lt;br /&gt;
| Creates a subdirectory named &amp;lt;code&amp;gt;vlc-x.x.x&amp;lt;/code&amp;gt; with all the binaries. You can run VLC directly from this directory.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;make package-win-strip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Same as above but will create &#039;stripped&#039; binaries (that is, smallest size, unusable with a debugger).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;make package-win32-7zip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Same as above but will package the directory in a 7z file.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;make package-win32-zip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Same as above but will package the directory in a zip file.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;make package-win32&amp;lt;/code&amp;gt;&lt;br /&gt;
| Same as above but will also create an auto-installer package. You must have NSIS installed in its default location for this to work.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Well done—you&#039;re ready to use VLC!&#039;&#039;&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[Category:Building]]&lt;/div&gt;</summary>
		<author><name>BonzaiThePenguin</name></author>
	</entry>
</feed>