<?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=Mx79</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=Mx79"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/Mx79/"/>
	<updated>2026-11-04T15:53:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Win32Compile&amp;diff=31748</id>
		<title>Win32Compile</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Win32Compile&amp;diff=31748"/>
		<updated>2017-01-03T18:08:01Z</updated>

		<summary type="html">&lt;p&gt;Mx79: fixes to the use of host triplet in code examples&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 involving cross-compilation from Linux. On computers running Microsoft Windows, a virtual machine is necessary to run Linux.&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. MSYS is a minimal build environment to compile Unix-style projects directly on Microsoft Windows. This is &#039;&#039;&#039;not officially supported&#039;&#039;&#039; by VideoLAN. Best of 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;
| Cygwin method. Cygwin emulates a POSIX environment to compile on Microsoft Windows. This is &#039;&#039;&#039;error&#039;&#039;&#039;-prone and &#039;&#039;&#039;slow&#039;&#039;&#039; and therefore not recommended.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Obtaining the cross-compilation toolchain  ==&lt;br /&gt;
All this howto is focused on  &#039;&#039;&#039;Debian/Ubuntu&#039;&#039;&#039;. For other distribution, please find the related package names, but they should be very similar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ubuntu 14.04&#039;&#039;&#039; is too old to compile VLC.&lt;br /&gt;
&lt;br /&gt;
=== Host triplet ===&lt;br /&gt;
A number of commands below include the toolchain identifier, called the &#039;&#039;host triplet&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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;
The exact value depends on your installation of the toolchain.&lt;br /&gt;
&lt;br /&gt;
Notably on Debian/Ubuntu, these values must be used:&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;
&lt;br /&gt;
Please make sure that you replace the keywords &#039;&#039;HOST-TRIPLET&#039;&#039; with either &#039;&#039;i686-w64-mingw32&#039;&#039; or &#039;&#039;x86_64-w64-mingw32&#039;&#039; adapted to your target Windows version (32-bit or 64-bit, respectively)&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;
For the 32-bit version, run this:&lt;br /&gt;
 # apt-get install gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools&lt;br /&gt;
&lt;br /&gt;
For the 64-bit version, this becomes:&lt;br /&gt;
 # apt-get install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64-tools&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB:&#039;&#039;&#039; it is likely that you need mingw-w64 version 5.0 to compile it.&lt;br /&gt;
&lt;br /&gt;
=== Development tools ===&lt;br /&gt;
You will also need:&lt;br /&gt;
* lua (5.2)&lt;br /&gt;
* all autotools: libtool, automake, autoconf, autopoint, make, gettext, pkg-config&lt;br /&gt;
* qt4-dev-tools, qt5-default (or qt4-default if qt plugin build fails)&lt;br /&gt;
* git, subversion 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;
&#039;&#039;&#039;Run:&#039;&#039;&#039;&lt;br /&gt;
 # apt-get install lua5.2 libtool automake autoconf autopoint make gettext pkg-config&lt;br /&gt;
 # apt-get install qt4-dev-tools qt5-default git subversion cmake cvs &lt;br /&gt;
 # apt-get install wine64-development-tools zip p7zip nsis bzip2&lt;br /&gt;
 # apt-get install yasm ragel ant default-jdk protobuf-compiler dos2unix&lt;br /&gt;
&lt;br /&gt;
== Get the source code ==&lt;br /&gt;
 $ git clone http://git.videolan.org/git/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;
VLC depends on a sizable number of third party libraries. Before compiling VLC, you need to obtain compiled versions of those. There are two ways to achieve that:&lt;br /&gt;
* The &#039;&#039;prebuilt&#039;&#039; approach is much faster and easier, but only works with a narrow set of VLC versions.&lt;br /&gt;
* The &#039;&#039;manual build&#039;&#039; approach takes a lot of time and disk space, and somewhat error-prone.&lt;br /&gt;
&lt;br /&gt;
Please note that the prebuilt library versions are intended for the latest current &#039;&#039;stable release&#039;&#039; of VLC. It is not compatible with old VLC versions, nor with newer or future versions.&lt;br /&gt;
&lt;br /&gt;
At the time of writing (late 2016), the prebuilt libraries work with VLC 2.2.x &#039;&#039;&#039;only&#039;&#039;&#039;. To compile the VLC 3.0.x development branch, &#039;&#039;&#039;DO NOT USE&#039;&#039;&#039; the prebuilt libraries.&lt;br /&gt;
&lt;br /&gt;
=== Prebuilt (fast) ===&lt;br /&gt;
  $ mkdir -p contrib/win32&lt;br /&gt;
  $ cd contrib/win32&lt;br /&gt;
  $ ../bootstrap --host=HOST-TRIPLET&lt;br /&gt;
  $ make prebuilt&lt;br /&gt;
&lt;br /&gt;
=== Manually built (slow) ===&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 ragel autopoint&lt;br /&gt;
&lt;br /&gt;
  $ mkdir -p contrib/win32&lt;br /&gt;
  $ cd contrib/win32&lt;br /&gt;
  $ ../bootstrap --host=HOST-TRIPLET&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 host triplet is not &#039;&#039;&#039;i686-w64-mingw32&#039;&#039;&#039; (you are &#039;&#039;not&#039;&#039; compiling for Debian or Ubuntu), create a symlink to contribs:&lt;br /&gt;
 $ ln -sf &#039;&#039;&#039;&#039;HOST-TRIPLET&#039;&#039;&#039;&#039; ../i686-w64-mingw32&lt;br /&gt;
Notice that there is no &amp;lt;code&amp;gt;../&amp;lt;/code&amp;gt; before the host triplet. This is intentional, and if done properly, you should see a functioning symbolic link created in the parent directory (try &amp;lt;code&amp;gt;ls -l ..&amp;lt;/code&amp;gt; and you should see &amp;lt;code&amp;gt;i686-w64-mingw32 -&amp;gt; x86_64-w64-mingw32/&amp;lt;/code&amp;gt;).&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/HOST-TRIPLET/lib/pkgconfig&lt;br /&gt;
  $ export PKG_CONFIG_PATH_CUSTOM=$PKG_CONFIG_LIBDIR (for Archlinux only)&lt;br /&gt;
&lt;br /&gt;
Execute the build configuration script:&lt;br /&gt;
 $ ../extras/package/win32/configure.sh --host=HOST-TRIPLET --build=x86_64-pc-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;N.B.&#039;&#039;&#039;:&lt;br /&gt;
Use the host and build tuples respectively corresponding to &#039;&#039;&#039;your&#039;&#039;&#039; cross-compilation toolchain and build system respectively. The example above assumes you are compiling for &#039;&#039;Windows&#039;&#039; OS and &#039;&#039;Intel 686&#039;&#039; architecture, and the build system is &#039;&#039;GNU/Linux&#039;&#039; OS and &#039;&#039;x86 64-bits&#039;&#039; architecture. See [[#Host_triplet|above]] for list of common values.&lt;br /&gt;
&lt;br /&gt;
Also, if you have a problem here (such as an error about Library dvdread), see the [[Talk:Win32Compile|Talk]] page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can run configure manually:&lt;br /&gt;
 $ ../configure --host=HOST-TRIPLET --build=x86_64-pc-linux-gnu&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;
== Extra information ==&lt;br /&gt;
&lt;br /&gt;
=== Static compilation of plugins ===&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;
[[Category:Building]]&lt;/div&gt;</summary>
		<author><name>Mx79</name></author>
	</entry>
</feed>