Linking GetUILanguageFallbackList API with MinGW-w64

I’m trying to use the Windows GetUILanguageFallbackList API with MinGW-w64.

Here is a very minimalistic example of calling the API:

#include <windows.h>
#include <muiload.h>

int main() {
    GetUILanguageFallbackList(NULL, 0, NULL);
    return 0;
}

Now, I’m not expecting that code to actually do anything useful, since I haven’t supplied a valid combination of parameters. But all I’m trying to do at this point, is get the code to compile and link. I actually have a longer example which attempts to use the API properly, but I created the above minimal version just to reproduce my linking issue. So I save that as uilang0.c.

But when I try to compile, linking fails with the below error:

# gcc -o uilang0 uilang0.c
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:toolsmsys64tmpcclvYTlj.o:uilang0.c:(.text+0x1e): undefined reference to `GetUILanguageFallbackList'
collect2.exe: error: ld returned 1 exit status

There is a muiload.lib with the Windows SDK, but I can’t find an equivalent for MinGW-w64, even though it does provide the muiload.h header file. I tried linking with that; that fixed the above linker error but introduced even more linker errors:

# gcc -o uilang0 uilang0.c /c/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/minkernel/crts/crtw32/misc/nt/objfre/amd64/guard_support.obj):(.00cfg[__guard_check_icall_fptr]+0x0): undefined reference to `_guard_check_icall_nop'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/minkernel/crts/crtw32/misc/nt/objfre/amd64/guard_support.obj):(.00cfg[__guard_xfg_check_icall_fptr]+0x0): undefined reference to `_guard_check_icall_nop'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/onecore/base/mui/muiload/lib/objfre/amd64/getuilanguagefallbacklist.obj):(.text$mn+0xe): undefined reference to `__security_cookie'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/onecore/base/mui/muiload/lib/objfre/amd64/getuilanguagefallbacklist.obj):(.text$mn+0x92): undefined reference to `__security_check_cookie'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/onecore/base/mui/muiload/lib/objfre/amd64/getuilanguagefallbacklist.obj):(.text$mn+0x13): undefined reference to `__security_cookie'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/onecore/base/mui/muiload/lib/objfre/amd64/getuilanguagefallbacklist.obj):(.text$mn+0xfb): undefined reference to `__security_check_cookie'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/onecore/base/mui/muiload/lib/objfre/amd64/getuilanguagefallbacklist.obj):(.xdata[$unwind$?PreVistaFallback@@YAHKPEAKPEAG0@Z]+0x14): undefined reference to `__GSHandlerCheck'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/onecore/base/mui/muiload/lib/objfre/amd64/getuilanguagefallbacklist.obj):(.xdata[$unwind$?MultiStr_AddLangAndParentNames@@YAHPEAG_KG@Z]+0x10): undefined reference to `__GSHandlerCheck'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64/muiload.lib(d:/os/obj/amd64fre/onecore/base/mui/muiload/lib/objfre/amd64/multistr.obj):(.text$mn+0x7f): undefined reference to `StringCchCopyW'
collect2.exe: error: ld returned 1 exit status

I tried adding a bunch more Platform SDK .lib files, but no matter what combination I use, I still get undefined references. Adding BufferOverflowU.lib gets rid of the undefined reference to __security_cookie/__security_check_cookie. Adding ntdllp.lib gets rid of the undefined reference to __GSHandlerCheck. But I can’t seem to get rid of the _guard_check_icall_nop or StringCchCopyW undefined references. Also, I can’t help but worry that randomly adding libraries without knowing what I’m doing, even if I eventually get it to link, it might not work due to some incompatible combination.

5

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật