This is a new question resulting from a recent question of mine: compiling error gtk2 source with gtk3: ‘GtkStyle’ {aka ‘struct _GtkStyle’} has no member named ‘font’
make process of compiling emelfm, a gtk2 source program, in a current Gentoo linux gtk3 generated all .0 files (35) after making the following changes:
Makefile.common – replacing “gtk-config” and “glib-config” words with “pkg-config”:
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 = `pkg-config --cflags gtk+-2.0`
GTK_LIB = `pkg-config --libs gtk+-2.0`
GLIB_LIB = `pkg-config --libs gtk+-2.0`
CC = gcc -O2 -Wall
5 out of 35 .c files: “->” style statements produced errors, but “_get_active” style allowed compiling process to continue. These are the actual changes in those 5 .c files:
window.c
line 257 style->font = app.output_font;
style_get_active (app.output_font);
utils.c
line 275 system_ops[i].func(NULL);
i;
line 289 interface_ops[i].func(NULL);
i;
view_dialog.c
line 83 scrollbar = gtk_vscrollbar_new(GTK_TEXT(text_area)->vadj);
scrollbar_get_active (gtk_vscrollbar_new(GTK_TEXT(text_area)));
fileview.c
line 702 style->font = font;
style_get_active (gdk_font_load);
command_panel.c
line 450 style->font = app.output_font;
style_get_active (app.output_font);
line 382 adj = GTK_TEXT(app.output_text)->vadj;
adj_get_active (GTK_TEXT(app.output_text));
line 393 adj = GTK_TEXT(app.output_text)->vadj;
adj_get_active (GTK_TEXT(app.output_text));
However, the make process stops with DSO error:
gcc -O2 -Wall .... -o emelfm `pkg-config --libs gtk+-2.0`
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: plugins.o: undefined reference to symbol 'g_module_error'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libgmodule-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:22: emelfm] Error 1
The four dots represent list of 35 .o files
I realize I did not completely rewrite the .c files according to gte3 rules, but it looked like gtk3 was smart enough (AI?) to understand most statements with warnings, and I was happy to have the .o files done. Is there a similar shortcut, easy way to fix the linking problem?
Apparently libgmodule-2.0.so.0 is not in the path of something even though that file is in /usr/lib64.
Otherwise I’ll drop this challenge and continue to use xfe file manager. emelfm was on my older desktop, starting with Fedora-3.
Janos Komaromi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.