geoffreybennett/alsa-scarlett-gui

gtk4 4.10 deprecates many functions; `-Werror` causes build failures

Closed this issue · 4 comments

For example,

file.c: In function ‘add_state_filter’:
file.c:65:3: error: ‘gtk_file_chooser_add_filter’ is deprecated [-Werror=deprecated-declarations]
   65 |   gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(native), filter);

According to https://docs.gtk.org/gtk4/class.FileChooserNative.html , this is deprecated since 4.10 which is fairly recent anyway.

I suggest modifying the Makefile to remove the -Werror flag - I can patch that when packaging at my end, but perhaps should be addressed here too.

cmake build configurations can help with this : a debug build can enable -Werror where it is useful, and a quieter release build that makes it easier / for packagers. Is there any interest in moving beyond plain makefiles to something else - cmake or other ?

antode commented

If someone can't build binary and looking for workaround, try to:

  • open Makefile in editor /%repo_containing_dir%/alsa-scarlett-gui/src/Makefile, e.g.
    [ontosh@fedora ~]$ nano ~/tools/alsa-scarlett-gui/src/Makefile
  • add new line after
    CFLAGS += -DVERSION=\"$(VERSION)\"
  • and paste following expression:
    CFLAGS += -Wno-error=deprecated-declarations
  • run make -j4

Fixed in commit fb9ccfe.

@fenugrec "Is there any interest in moving beyond plain makefiles to something else - cmake or other ?"

Is cmake the preferred way to build Gtk4 apps? I have no idea what the standard practice is here; developing desktop apps is not my area of expertise. If anyone wants to make this better, contributions are welcome.

saxa commented

Hi, AFAIK meson is the way for most of the gtk/gnome apps. I think its also simple and easy to use and a well stabilized project. https://mesonbuild.com/