Trying to compile emelfm-0.9.2 with gtk3 (I'm not a coder just a linux enthusiast). Modified Makefile.common and now many of the .c files compiled OK. However, the window.c component stopped with the error in question:
window.c:257:10: error: ‘GtkStyle’ {aka ‘struct _GtkStyle’} has no member named ‘font’
257 | style->font = app.output_font;
| ^~
make: *** [Makefile:17: window.o] Error 1
The Makefile.common original version is:
PREFIX = /usr/local
BIN_DIR = $(PREFIX)/bin
LOCALEDIR = $(PREFIX)/share/locale
PLUGINS_DIR = $(PREFIX)/share/emelfm/plugins
DOC_DIR = $(PREFIX)/share/emelfm/docs
NLS = -DENABLE_NLS
GTK_INCLUDE = `gtk-config --cflags`
GTK_LIB = `gtk-config --libs`
GLIB_LIB = `glib-config --libs gthread`
CC = gcc -O2 -Wall
The modified section is:
NLS = -DENABLE_NLS
GTK_INCLUDE = `pkg-config --cflags gtk+-2.0`
GTK_LIB = `pkg-config --libs gtk+-2.0`
I modified it because "gtk-config" or "glib-config" command is now "pkg-config". As a result the "make" process started OK but could not finish because of the error in the window.c component.
Is there an easy fix to this?
Easy fix for non-coder? No, but doable. Let's begin with:
pkg-config --cflags gtk+-2.0
, where gtk+-2.0 uses... you guess it! Gtk2. If you want to build gtk3, you must use gtk+-3.0
.In GTK+ 3.0, GtkStyle has been deprecated and replaced by GtkStyleContext