Search code examples
cross-compilingvlclibvlcmingw-w64

Cross-Compiling VLC for Windows errors widl compiling dxgi1_2.idl wine header


I am trying to cross compile VLC for windows on a Debian 8.5 VM hosted on a MacBook Pro. I followed the instructions here: https://wiki.videolan.org/Win32Compile/

I am using the x86_64-w64-mingw32 host triplet.

Using the pre-compiled contribs resulted in an error. Following advice from this post: https://forum.videolan.org/viewtopic.php?f=32&t=134115

I built a new mingw64 using version 5.3.3 source but the build still failed. Following more advice from the videolan forums, I rebuilt the mingw64 compiler and attempted to compile the contribs. I encountered the same exception as reported in the forum posts. The relevant part of the console output from make is:

    mkdir -p dxgi12
    cp ../../contrib/tarballs/dxgi1_2.idl dxgi12 && cd dxgi12 && patch -fp1 < ../../../contrib/src/d3d11/dxgi12.patch
    patching file dxgi1_2.idl
    mkdir -p -- "/home/deb/vlc/contrib/x86_64-w64-mingw32/include/"
    x86_64-w64-mingw32-widl -DBOOL=WINBOOL -I/usr/include/wine/windows/ -h -o /home/deb/vlc/contrib/x86_64-w64-mingw32/include/dxgi1_2.h dxgi12/dxgi1_2.idl
    dxgi12/dxgi1_2.idl:43: error: syntax error, unexpected aKNOWNTYPE, expecting tIMPORT
    ../../contrib/src/d3d11/rules.mak:63: recipe for target '/home/deb/vlc/contrib/x86_64-w64-mingw32/include/dxgi1_2.h' failed
    make: *** [/home/deb/vlc/contrib/x86_64-w64-mingw32/include/dxgi1_2.h] Error 1

Since, as the above forum post points out, this is probably an issue with wine headers, I installed all the relevant wine development packages (I think) and retried the process but always ends with the same error.

I am certain that people have cross-compiled vlc for windows. I hope that someone can give me the steps to do it successfully.

Thanks in advance.


Solution

  • The problem was with the wine headers. I needed to point the rules.mak files to the /usr/include/wine-development/windows folder. I found the answer on the videolan forums: https://forum.videolan.org/viewtopic.php?f=32&t=134115

    apt-get install wine64-development-tools 
    modify contib\src\d3d9\rules.mak and contrib\src\d3d11\rules.mak IDL_INC_PATH = /usr/include/wine/windows/ to IDL_INC_PATH = /usr/include/wine-development/windows/