Skip to content

win32 cross-compiling fails in several ways and documentation needs updating

I've been trying to cross-compile win32 on an Ubuntu 18.04.2 LTS VM for a client and hit a lot of issues during a 4 days (er, nights) battle. For some reason they want a specific 3.0 version but I believe most of it is still relevant for the 4.x branch.

I'll try to list here what breaks, because I don't have access to the wiki. I finally managed to get a full build at least, so hopefully I got them all.

(or should I open separate tickets? I'm getting sleep deprived and so quite lazy.)

Notwithstanding the changes I had to backport from newer releases…

== Wiki misses apt packages

The Win32Compile wiki page lists a lot of packages but some are missing due either to changes in packaging or missed when adding them as requirements for the build or just being forgotten.

apt-get install flex bison nasm meson ninja-build libtool libtool-bin doxygen

== Prebuilt dependencies are linked with way too recent mingw

extras/package/win32/build.sh -p -a i686 always fails even on Ubuntu 18.04.2 because the prebuilt packages are linked with a mingw that has this patch.

I tried forcing the mingw packages to newer versions from the cosmic repository, but then it fails as in #18468 (closed).

(Someday maybe gcc will stop screwing up their ABI, but they have bin since 2.95 anyway, the very same reason Haiku requires using gcc 2.95 btw.)

== 32bit lua < 5.3

On my own machine I noticed I had to install lua5.2:i386 because for win32 it needs 32bit lua bytecode, and the configure test checks for some part of the generated bytecode header to be 0404 while lua5.3:i386 actually generates something else. And I had to force it with update-alternatives I think.

Although on the VM I don't remember having to do this.

== Building MSI package requires installing WiX Toolset 3

make package-msi (or extras/package/win32/build.sh -i n) fails with: wine: cannot find '/home/foo/.wine/dosdevices/c:/Program Files (x86)/Windows Installer XML v3.5/bin/heat.exe'

And it's nowhere mentioned that you have to install this, nor how.

I ended up having to:

apt-get remove wine64
dpkg --add-architecture i386 && apt-get update && apt-get install wine32 winetricks
wget https://dl.winehq.org/wine/wine-mono/4.8.0/wine-mono-4.8.0.msi
wine msiexec /i wine-mono-4.8.0.msi
wget https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311-binaries.zip
mkdir -p ~/'.wine/dosdevices/c:/Program Files (x86)/Windows Installer XML v3.5/bin'
unzip -d ~/'.wine/dosdevices/c:/Program Files (x86)/Windows Installer XML v3.5/bin' wix311-binaries.zip

(I first tried winetricks dotnet35 but got fed up of the clic-o-drome (oh and it required ssh -X of course))

(Couldn't we use MSItools instead of having to require wine and mono??)

== Building MSI package requires NLS ie. extras/package/win32/build.sh -i n requires -l

Else we get: heat.exe : error HEAT5052 : The directory 'Z:\home\…\VLC-~VCE.4\locale' could not be found.

Because msi.mak doesn't account for USE_NLS=no

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information