Cross-compiling Windows 64-bit VLC instructions

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
sabayondessert
New Cone
New Cone
Posts: 2
Joined: 23 Aug 2018 07:09
VLC version: 3.0.4; 4.0.0-dev
Operating System: Windows/Linux/macOS

Cross-compiling Windows 64-bit VLC instructions

Postby sabayondessert » 30 Aug 2018 10:58

Below is a list of instructions that describe how I compiled the development version of VLC. It’s based on the compiling cheat sheet listed here:

https://forum.videolan.org/viewtopic.ph ... 89#p475525

I originally followed these instructions and soon realized there were other things I needed to do in order to get this to build successfully. Some of those things are listed in the first section. The second section lists the original steps from the cheat sheet (for the most part) with some minor changes I needed to make to get this to build correctly. If you want to give this a shot, I suggest starting from the first section for some background info. Then follow the steps in the second section. The goal here is to list steps that will yield a successful build as well as reduce the time it takes for someone starting from scratch to learn how to compile this.

Issues and changes from the cheat sheet (in no particular order)

1. Follow the steps EXACTLY as they are listed in the next section. It should go smoothly if you do this. I had an issue with Step 16 at first-if you get an error that says ‘./boostrap needs to be run in a subdirectory’, work your way back to the git ‘vlc’ directory reached at Step 11 and try it again.

2. In step 3 and step 6, if you're logged in as a standard user, you need to use sudo in front of the command (change from cheat sheet). If not you will get errors saying failed to get default registry endpoint from daemon (permission denied), etc. This is just because you need to use sudo in front of the docker pull command and not an issue with your internet.

3. Steps 7 and 8 were added because I needed to update the packages and install python inside the docker image. If you don’t, make will complain in step 21 that python is needed compile Qt and that it’s missing. Installing python here will allow you to follow the steps cleanly until the end.

4. I added Step 1 and changed Step 2 from the cheat sheet. Installing docker is not a trivial thing-you can’t just run ‘sudo apt-get install docker-ce’ right out of the box. You need to install the repositories and other stuff. The link in Step 1 will explain how to do this. Note: You only need to follow the instructions listed in Step 1 contained in the link. The other steps describe how to install docker an optional way and how to use docker. You can confirm the installation at the end of the Step 1 instructions.

5. There are instructions on installing Docker for other versions of Ubuntu in the link, which translates to other versions of Linux Mint. If you’re running a different distro/etc., performing these steps prior to installing docker seems like a common thing folks need to do in order to run it regardless of the system. A quick search of the internet about installing it on your flavor of Linux should be fruitful.

6. In Step 3 and Step 6, I used the 64-bit image: vlc-debian-win64. This is a change from the cheat sheet. These steps here will probably work the same with vlc-debian-win32, however I haven’t tried it (yet).

7. It took my system approximately 2.5 hours to compile (complete Step 15). Tack on another hour for the rest of the stuff and it should take about 3.5 hours to have a compiled version that can be installed on 64-bit Windows. My machine specs are listed below so if you have a different setup, your time will probably be different, and hopefully faster.

8. These steps were valid 8-29-18. I can’t guarantee they will work any time after that. I could return to this in 3 months and end up in the weeds. I wanted to learn how to compile this version of VLC so I could confirm a separate issue I found in a previous version (3.0.3).

Steps to compile development version of VLC

1 Install docker: For docker-ce you have to add the prerequisites and the repository. If your using Linux Mint 19/Ubuntu 18.04 follow the instructions to install it here:
https://www.digitalocean.com/community/ ... untu-18-04
2 Verify docker has been successfully installed-completed in Step 1 above and in the link. (The original command "sudo apt-get install docker-ce" from the cheat sheet is executed in Step 1 now. )
3 sudo docker pull registry.videolan.org:5000/vlc-debian-win64
4 cd ~
5 mkdir win64
6 sudo docker run -v ~/win64:/win64 -i -t registry.videolan.org:5000/vlc-debian-win64 /bin/bash (...you will now be running the build environment from a docker container as root)
7 apt-get update (updates the docker repositories)
8 apt-get install python (installs python on the docker image. Needed to compile Qt stuff later)
9 cd win64
10 git clone https://git.videolan.org/git/vlc
11 cd vlc
12 mkdir -p contrib/win32
13 cd contrib/win32
14 ../bootstrap --host=x86_64-w64-mingw32 –disable-protobuf
15 make - (... this will take some time so turn off screensaver and go out for lunch)
16 cd -
17 ./bootstrap (note the dot-slash as opposed to the dot-dot-slash in Step 13)
18 mkdir win32
19 cd win32
20 ../extras/package/win32/configure.sh --host=x86_64-w64-mingw32 –build=x86_64-pc-linux-gnu
21 make
22 make package-win32[/list]

Original cheat sheet link here (again):
https://forum.videolan.org/viewtopic.ph ... 89#p475525

Development machine summary:

VirtualBox guest system
Distribution: Linux Mint 19 Mate 64-bit (fresh install out of the box)
Memory: 4 GB
Processor count: 2
Virtual HDD 1: 50 GB
Virtual HDD 2: 75 GB
User: Normal user privileges (not Administrator or root)

Host system
Windows 10 Pro
12 GB memory
4th Gen Intel i7

garf
Developer
Developer
Posts: 132
Joined: 19 Jul 2017 09:38

Re: Cross-compiling Windows 64-bit VLC instructions

Postby garf » 31 Aug 2018 09:57

Hello,

nice tutorial !
One quick tip: steps 12-22 can now be replaced with the included build script:

Code: Select all

./extras/package/win32/build.sh -a x86_64 -i r

sabayondessert
New Cone
New Cone
Posts: 2
Joined: 23 Aug 2018 07:09
VLC version: 3.0.4; 4.0.0-dev
Operating System: Windows/Linux/macOS

Re: Cross-compiling Windows 64-bit VLC instructions

Postby sabayondessert » 03 Sep 2018 01:33

Thanks, and thanks for posting this!! I've updated the instructions and listed them below:

1 Install docker: For docker-ce you have to add the prerequisites and the repository. If your using Linux Mint 19/Ubuntu 18.04 follow the instructions to install it here: Install Docker on Linux Mint 19/Ubuntu 18.04
2 Verify docker has been successfully installed-completed in Step 1 above and in the link. (The original command "sudo apt-get install docker-ce" from the cheat sheet is executed in Step 1 now. )
3 sudo docker pull registry.videolan.org:5000/vlc-debian-win64
4 cd ~
5 mkdir win64
6 sudo docker run -v ~/win64:/win64 -i -t registry.videolan.org:5000/vlc-debian-win64 /bin/bash (...you will now be running the build environment from a docker container as root)
7 apt-get update (updates the docker repositories)
8 apt-get install python (installs python on the docker image. Needed to compile Qt stuff later)
9 cd win64
10 git clone https://git.videolan.org/git/vlc
11 cd vlc
12 ./extras/package/win32/build.sh -a x86_64 -i r

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: Cross-compiling Windows 64-bit VLC instructions

Postby mangup » 17 Apr 2019 15:06

Qt is compiled from scratch on step 12?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Cross-compiling Windows 64-bit VLC instructions

Postby Jean-Baptiste Kempf » 19 Apr 2019 07:24

Qt is compiled from scratch on step 12?
Yes.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

gkaplan
New Cone
New Cone
Posts: 2
Joined: 09 Jan 2022 07:21

Re: Cross-compiling Windows 64-bit VLC instructions

Postby gkaplan » 09 Jan 2022 07:42

Thanks for this very helpful thread. The one problem I encountered was the following, when the script gets to the part of building contribs:

Code: Select all

x86_64-w64-mingw32-g++ -c -pipe -fno-keep-inline-dllexport -isystem /win64/vlc/contrib/x86_64-w64-mingw32/include -O3 -std=c++1y -ffunction-sections -fdata-sections -fexceptions -mthreads -Wall -Wextra -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_DEBUG -DPCRE2_CODE_UNIT_WIDTH=16 -DPCRE2_STATIC -I. -I../3rdparty/zlib/src -Iglobal -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty -I../3rdparty/double-conversion/include -I../3rdparty/harfbuzz/src -I../3rdparty/tinycbor/src -I.rcc/release -I../../include -I../../include/QtCore -I../../include/QtCore/5.15.1 -I../../include/QtCore/5.15.1/QtCore -Itmp -I.moc/release -I.tracegen/release -I../3rdparty/pcre2/src -I../../mkspecs/win32-g++ -o .obj/release/qprocess.o io/qprocess.cpp In file included from ../../include/QtCore/qsocketnotifier.h:1:0, from io/qprocess.cpp:94: ../../include/QtCore/../../src/corelib/kernel/qsocketnotifier.h:113:33: error: enclosing class of constexpr non-static member function 'void* QSocketDescriptor::winHandle() const' is not a literal type Q_DECL_CONSTEXPR Qt::HANDLE winHandle() const noexcept { return sockfd; } ^~~~~~~~~ ../../include/QtCore/../../src/corelib/kernel/qsocketnotifier.h:94:7: note: 'QSocketDescriptor' is not literal because: class QSocketDescriptor ^~~~~~~~~~~~~~~~~ ../../include/QtCore/../../src/corelib/kernel/qsocketnotifier.h:94:7: note: 'QSocketDescriptor' is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor ../../include/QtCore/../../src/corelib/kernel/qsocketnotifier.h:115:22: error: enclosing class of constexpr non-static member function 'QSocketDescriptor::operator QSocketDescriptor::DescriptorType() const' is not a literal type Q_DECL_CONSTEXPR operator DescriptorType() const noexcept { return sockfd; } ^~~~~~~~ Makefile.Release:39308: recipe for target '.obj/release/qprocess.o' failed make[4]: *** [.obj/release/qprocess.o] Error 1 make[4]: Leaving directory '/win64/vlc/contrib/contrib-win64/qt/src/corelib' Makefile:45: recipe for target 'release' failed make[3]: *** [release] Error 2 make[3]: Leaving directory '/win64/vlc/contrib/contrib-win64/qt/src/corelib' Makefile:227: recipe for target 'sub-corelib-make_first' failed make[2]: *** [sub-corelib-make_first] Error 2 make[2]: Leaving directory '/win64/vlc/contrib/contrib-win64/qt/src' Makefile:53: recipe for target 'sub-src-make_first' failed make[1]: *** [sub-src-make_first] Error 2 make[1]: Leaving directory '/win64/vlc/contrib/contrib-win64/qt' ../src/qt/rules.mak:108: recipe for target '.qt' failed make: *** [.qt] Error 2
I can't imagine it being a problem with my Linux server, because I followed the instructions on a freshly created VirtualBox Ubuntu 18.04 VM. Was a problem introduced when the Git was updated with Qt version 5.15.1?

Any advice about this will be much appreciated.

gkaplan
New Cone
New Cone
Posts: 2
Joined: 09 Jan 2022 07:21

Re: Cross-compiling Windows 64-bit VLC instructions

Postby gkaplan » 10 Jan 2022 03:05

I can't imagine it being a problem with my Linux server, because I followed the instructions on a freshly created VirtualBox Ubuntu 18.04 VM. Was a problem introduced when the Git was updated with Qt version 5.15.1?

Any advice about this will be much appreciated.
I resolved this by
1. changing /etc/apt/sources.list to point to the bionic repos,
2. installing the gcc-mingw-w64-x86-64 package to get version 7.3 of the x86_64-w64-mingw32-g++ cross compiler, and
3. changing $PATH to point to it in /usr/bin.

puranik9702
New Cone
New Cone
Posts: 1
Joined: 31 Jan 2022 10:56

Re: Cross-compiling Windows 64-bit VLC instructions

Postby puranik9702 » 02 Feb 2022 12:25

Hello,
I am following the steps given on Cross-compiling Windows 64-bit VLC instructions.

I am getting the following error for step 21

Makefile:20669: recipe for target 'libvnc_plugin.la' failed
make[4]: *** [libvnc_plugin.la] Error 1
make[4]: Leaving directory '/win64/vlc/win32/modules'
Makefile:32646: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/win64/vlc/win32/modules'
Makefile:12708: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/win64/vlc/win32/modules'
Makefile:1583: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/win64/vlc/win32'
Makefile:1470: recipe for target 'all' failed
make: *** [all] Error 2

Please suggest

its_ayush_07
New Cone
New Cone
Posts: 4
Joined: 11 Feb 2023 14:12

Re: Cross-compiling Windows 64-bit VLC instructions

Postby its_ayush_07 » 14 Apr 2023 09:53

I can't imagine it being a problem with my Linux server, because I followed the instructions on a freshly created VirtualBox Ubuntu 18.04 VM. Was a problem introduced when the Git was updated with Qt version 5.15.1?

Any advice about this will be much appreciated.
I resolved this by
1. changing /etc/apt/sources.list to point to the bionic repos,
2. installing the gcc-mingw-w64-x86-64 package to get version 7.3 of the x86_64-w64-mingw32-g++ cross compiler, and
3. changing $PATH to point to it in /usr/bin.
This didn't work. Can you suggest some other solution?


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 47 guests