FWIW, I have now built gnome-mahjongg, cairo gdk-pixbuf glib2, gtk3, and librsvg with gcc12/gcc12-c++, but unfortunately the program still behaves as described. So I don't know where the error comes from :(