TreePath comparison operators not exported properly (mingw-w64, regression in gtkmm 3.24.3)
After the recent update to gtkmm 3.24.3 (mingw-w64-x86_64-gtkmm3-3.24.3-1 via MSYS2) we're seeing build failures in Inkscape:
[1053/1057] Linking CXX shared library bin\libinkscape_base.dll
FAILED: bin/libinkscape_base.dll lib/libinkscape_base.dll.a
cmd.exe /C "cd . && C:\msys64\mingw64\bin\g++.exe -DG_DISABLE_ASSERT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Werror=format -Werror=format-security -mms-bitfields -mwindows -mthreads -m64 -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -pthread -mms-bitfields -mms-bitfields -fopenmp -O3 -DNDEBUG -shared -o bin\libinkscape_base.dll -Wl,--out-implib,lib\libinkscape_base.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\inkscape_base.rsp && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/CMakeFiles/inkscape_base.dir/ui/dialog/attrdialog.cpp.obj:attrdialog.cpp:(.text+0x738): undefined reference to `Gtk::operator==(Gtk::TreePath const&, Gtk::TreePath const&)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/CMakeFiles/inkscape_base.dir/ui/dialog/objects.cpp.obj:objects.cpp:(.text+0x7fd9): undefined reference to `Gtk::operator==(Gtk::TreePath const&, Gtk::TreePath const&)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/CMakeFiles/inkscape_base.dir/ui/dialog/selectorsdialog.cpp.obj:selectorsdialog.cpp:(.text+0x1d2e): undefined reference to `Gtk::operator==(Gtk::TreePath const&, Gtk::TreePath const&)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/CMakeFiles/inkscape_base.dir/ui/dialog/styledialog.cpp.obj:styledialog.cpp:(.text+0xbb): undefined reference to `Gtk::operator==(Gtk::TreePath const&, Gtk::TreePath const&)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/CMakeFiles/inkscape_base.dir/ui/dialog/undo-history.cpp.obj:undo-history.cpp:(.text+0x231): undefined reference to `Gtk::operator<(Gtk::TreePath const&, Gtk::TreePath const&)'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Error: compilation failed
Apparently the comparison operators for Gtk::TreePath
are not exported properly by the library and linking therefore fails due to undefined references.
@fanc999 I assume this is related to c123cf9d in some way or another, maybe GTKMM_API
not being set properly or the decoration not being correctly applied to the functions in question?
I tried adding GTKMM_API
to https://gitlab.gnome.org/GNOME/gtkmm/-/blob/c123cf9df09ebfe31aba867db1e364af074efe71/gtk/src/treepath.hg#L165:
- _WRAP_COMPARE(gtk_tree_path_compare)
+ _WRAP_COMPARE(gtk_tree_path_compare, , GTKMM_API)
However that did not seem to do the trick and I'm pretty much out of ideas now (also not overly familiar with m4 language unfortunately to see if something's wrong there).