Missing glib::thread_supported symbols in libglibmm-2.4.dll.a
Description / Steps to reproduce the issue
- Install
glibmmand dependencies withpacman -S mingw-w64-ucrt-x86_64-glibmm - Write and compile a simple program with
g++ test.cpp $(pkg-config --cflags --libs glibmm-2.4)
#include <glibmm/thread.h>
int main() {
if (!Glib::thread_supported()) {
Glib::thread_init();
}
}
- Linking failed with
D:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
D:\msys64\tmp\cc7HK0ft.o:test.cpp:(.text+0xe): undefined reference to `Glib::thread_supported()'
D:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
D:\msys64\tmp\cc7HK0ft.o:test.cpp:(.text+0x1f): undefined reference to `Glib::thread_init(_GThreadF
unctions*)'
Further investigation shows that these symbols are missing from libglibmm-2.4.dll.a and libglibmm-2.4.dll but not libglibmm-2.4.a:
$ nm -C libglibmm-2.4.dll.a | grep supported
0000000000000000 I __imp__ZN4Glib6Module13get_supportedEv
0000000000000000 T Glib::Module::get_supported()
$ nm -C libglibmm-2.4.a | grep supported
00000000000001b0 T Glib::Module::get_supported()
U g_module_supported
0000000000000360 T Glib::thread_supported()
I crosschecked its presence on an WSL2 Ubuntu distro:
$ sudo apt install libgtkmm-3.0-dev
# ......
$ nm -gDC libglibmm-2.4.so | grep supported
U g_module_supported
0000000000050d10 T Glib::thread_supported()
0000000000047d30 T Glib::Module::get_supported()
$ g++ test.cpp `pkg-config --cflags --libs glibmm-2.4`
$ ./a.out
# Compiles and runs successfully.
I understand that multithreading can be difficult to port between different systems, and am not sure whether its absence is intended. But I suppose I'd better post it here to verify.
Expected behavior
Program compiles, links and runs successfully.
Actual behavior
Linking failed with undefined reference.
Verification
- [X] I have verified that my MSYS2 is up-to-date before submitting the report (see https://www.msys2.org/docs/updating/)
Windows Version
MINGW64_NT-10.0-19045
MINGW environments affected
- [ ] MINGW64
- [ ] MINGW32
- [X] UCRT64
- [ ] CLANG64
- [ ] CLANGARM64
Are you willing to submit a PR?
No response
The current version of the package is 2.82 https://packages.msys2.org/base/mingw-w64-glibmm-2.68. You are using an outdated and unsupported package version.
You are using an outdated and unsupported package version.
glibmm is not unsupported versions. It's like gtk3 vs. gtk4 - same project but different API/ABI https://packages.msys2.org/search?q=glibmm
I ran into the same problem with https://packages.msys2.org/packages/mingw-w64-x86_64-glibmm trying to compile Ardour. Anyone know a workaround?
Please report it to upstream glibmm repository. I have asked about this issue in matrix.