Page 1 of 1

cross-compiling for win32: error: ‘GetUserDefaultLocaleName’ was not declared in this scope

Posted: 01 Apr 2023 12:27
by its_ayush_07
Hi,

I am trying to build VLC 4.0 for a Windows 64 bit system by cross compiling it from Ubuntu 22.04. I am following this doc https://wiki.videolan.org/Win32Compile
I am compiling the contribs manually as the prebuilt libraries are outdated (works for VLC 2.2.x only).
I am facing the following error:

Code: Select all

/home/its-ayush-07/Desktop/vlc/contrib/win32/libaribcaption/src/renderer/font_provider_directwrite.cpp: In function ‘uint32_t aribcaption::GetDWriteLocaleIndex(IDWriteLocalizedStrings*)’: /home/its-ayush-07/Desktop/vlc/contrib/win32/libaribcaption/src/renderer/font_provider_directwrite.cpp:91:19: error: ‘GetUserDefaultLocaleName’ was not declared in this scope; did you mean ‘GetUserDefaultUILanguage’? 91 | int success = GetUserDefaultLocaleName(locale_name, LOCALE_NAME_MAX_LENGTH); | ^~~~~~~~~~~~~~~~~~~~~~~~ | GetUserDefaultUILanguage ninja: build stopped: subcommand failed.
Steps followed to build contribs manually before getting the error:

Code: Select all

$ sudo apt-get install subversion yasm cvs cmake ragel autopoint $ mkdir -p contrib/win32 $ cd contrib/win32 $ ../bootstrap --host=x86_64-w64-mingw32 $ make fetch $ make
Any help would be appreciated :D

Re: cross-compiling for win32: error: ‘GetUserDefaultLocaleName’ was not declared in this scope

Posted: 01 Apr 2023 15:04
by Rémi Denis-Courmont
I guess you need a pretty bleeding-edge version of Mingw-w64, which Ubuntu LTS probably doesn't have.

Re: cross-compiling for win32: error: ‘GetUserDefaultLocaleName’ was not declared in this scope

Posted: 05 Apr 2023 13:33
by its_ayush_07
I guess you need a pretty bleeding-edge version of Mingw-w64, which Ubuntu LTS probably doesn't have.
mingw-w64 8.0.0 is the maximum version supported in Ubuntu 22.04. Any suggestions on how to install the bleeding-edge version on Ubuntu 22.04?

Re: cross-compiling for win32: error: ‘GetUserDefaultLocaleName’ was not declared in this scope

Posted: 24 Apr 2023 11:38
by chubinou
you may use the docker image that our CI uses [1], it should contains the right version of mingw and other tools required to cross compile from linux. alternatively you may have a look at how our CI images are built [2].

Process for building on windows is documented here [3]

[1] https://code.videolan.org/videolan/vlc/ ... ci.yml#L21
[2] https://code.videolan.org/videolan/dock ... Dockerfile
[3] https://code.videolan.org/videolan/vlc/ ... D-win32.md