Countless "undefined reference to" error messages during gtk build

Ok, during gtk 2.24-1 compilation I am facing gazillions of error messages of “undefined reference to”

some examples:

/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_checksum_update'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_sequence_iter_move'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_main_context_pop_thread_default'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_variant_type_is_variant'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_variant_dup_objv'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_close'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_variant_builder_end'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_variant_compare'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_uri_unescape_string'
/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/libgio-2.0.so: undefined reference to `g_compute_checksum_for_string

At first seems they are all related to libgio-2.0.so from glib, however:

/media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.22.1/lib/libgdk_pixbuf-2.0.so: undefined reference to `g_mutex_unlock'

/media/34GB/Arquivos-de-Programas-Linux/Pango-1.20.0//lib/libpango-1.0.so: undefined reference to `g_assertion_message_expr'

/media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.22.1/lib/libgdk_pixbuf-2.0.so: undefined reference to `g_set_error_literal'
/media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.22.1/lib/libgdk_pixbuf-2.0.so: undefined reference to `g_mutex_lock

/media/34GB/Arquivos-de-Programas-Linux/Pango-1.20.0//lib/libpango-1.0.so: undefined reference to `g_unichar_get_script'

so, there are a couple pango and gdk error messages.

After seeing all those, I went to read the INSTALL and there it says:

GTK+ 2.24.1 requires at least GLib 2.25.10,
Pango 1.20, GdkPixbuf 2.21.0, ATK 1.29.2 and cairo 1.6.0.
gobject-introspection 0.9.3 or newer.

The glib, Pango and Gdk versions that I passed to configure are new enough, 2.48, 1.20 and 2.22.1 respectively. However, I had no idea about anything related to gobject-introspection (should have read the INSTALL, however configure did not mention anything about)

So, I need to know if these errors messages are related to not passing gobject-introspection to PKG_CONFIG_PATH, if they are related to versions of these three libraries, related to both or\and something else.

In case someone find relevant, here my configure:

LD_LIBRARY_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/
CPPFLAGS="-I/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/include/ -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/include/ -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xextproto-7.0.2/include/"
LDFLAGS="-L/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/ -L/media/34GB/Arquivos-de-Programas-Linux/xorg/Xext-1.0.0/lib/ -L/media/34GB/Arquivos-de-Programas-Linux/xorg/Xrender-0.9.0.2/lib/"  ./configure  --prefix=/media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.1
PKG_CONFIG_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Atk-1.29.3/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pango-1.20.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.22.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pixman-0.18.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Fontconfig-2.4.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Freetype-2.2.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/GL/:/media/34GB/Arquivos-de-Programas-Linux/Png-1.2.14/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xcb-1.13/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Pthread-stubs-0.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xau-1.0.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/share/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xrender-0.9.0.2/lib/pkgconfig/

Why are you building GTK2, which is obsolete ?

GTK3 is the supported release and GTK4 is the way going forward.

Thanks!

Perhaps because the program I intend to uses Gtk2 ? In fact only he latest version (not the one I am trying to build) supports both, and I am building both.

Anyway. Many programs uses Gtk (including nearly everything I use).

Finally, this problem is just one more, among many that I faced while building Gtks and their components that shows the disaster that it is the entire building process of the Gtk stack

  1. Which distro do you use ?

  2. Why do you need to build GTK2 ? Doesn’t your distro have a GTK2 library ?

  3. Doesn’t your distro have an automated way to build GTK2 from source ?

1)Not important (see 3)

2)See previous topic: Gtk 2 application does not star because symbol lookup error

3)Yes, but is irrelevant (see 2)). Plus, I gave up on using package managers, except for a few things.

Your build environment is broken, just like the other time you asked.

You are tweaking your environment manually, and you probably missing something—though it’s hard to understand what.

I’m sorry, but if you don’t know how to build complex software stacks, then I would not recommend you do it manually. You could look into tools like jhbuild, BuildStream, or Yocto. You could also look at the Linux From Scratch project.

1 Like

The symbol lookup order is:

  1. 'rpath' in binary
  2. 'LD_LIBRARY_PATH' env variable
  3. 'runpath' in binary

So, you might want to check if the palemoon elf has rpath set.

Refer rpath vs runpath and Can I change ‘rpath’ in an already compiled binary?

If you want to find the answer to the symbol issue, you can start the binary with LD_DEBUG=libs env variable, and figure out how the lookup of particular symbol in question is resolved.

Thanks!

Your build environment is broken, just like the other time you asked.

? Last time I was not building anything. Anyway, I am not sure what do you mean by “broken”. Obviously, it does not have everything necessary to build this Gtk version, although, I had nearly all required dependencies at the time, except by gobject-introspection. The fact it complained about symbols from pango and gdk, whose versions I am using, are equal and nearly equal, respectively, to the ones mentioned as the minimum requirements, leads me to believe that there is something broken with the gtk requirements, and not only with my system.

Anyway, the problem last time was simple: the symbol that palemoon requires, demands at least gtk 2.24, while the versions that I have here are inferior to that.

but if you don’t know how to build complex software stacks

If I am right, the problem might be poorly documented dependency requirement, . Xorg, for instance, is nowhere as problematic. For being sure, I have to compile gobject introspection. I might also test against the minimum required glib, instead the far newer one.

About the suggestions, I will look at linux from scratch build setup, if my next attempts fail. I might look into the tools if even this fails.

Now, my problem is passing the configure stage of gobject introspection. Once more, troubles.

While compiling it:

GEN g-ir-doc-tool
make[2]: *** No rule to make target /glib-2.0/include/glibconfig.h', needed by GLib-2.0.gir’. Stop.
make[2]: Leaving directory /media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.30.0' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.30.0’
make: *** [all] Error 2

The file “glibconfig.h”, that belongs to glib, is present on: .../Glib-2.48.0/lib/glib-2.0/include/glibconfig.h

So, what can be done?

New info. I compiled Glib-2.27-3 (the minimum required version, and replaced the newer 2.48 that I was using),. Rebuilded the Pango 1.20 that I was using and replaced gdk 2.22.1 by the 2.21.3 (again, minimum required version). Yet, countless undefined reference problems showed up.

Then I decided tosee the result of: objdump -t libgio-2.0.so | grep g_variant_type_is_tuple
and I got a 0000000000000000 F *UND* 0000000000000000 g_variant_type_is_tuple

Then I Tried objdump -t libgio-2.0.so | grep g_prefix_error and received:
0000000000000000 F UND 0000000000000000 g_prefix_error

This with Glib2.48. Redid the tests with the 2.27, and the results were the same. Did the same sort of test with Pango and Gdk, and the result was the same. Printed the table symbol for libpango, libgdk and libgio, and there was countless:

0000000000000000       F *UND*	0000000000000000    whatever_name 

Then I remember. When running configure (from gtk, but also from pretty much anything else) , I usually receive a:

/usr/bin/ld: Dwarf Error: found dwarf version ‘4’, this reader only handles version 2 and 3 information.

This made me to remeber that I am using a different compiler than the one provided. I uninstalled the default gcc, and created a symbolic link to a newer one on /usr/local/bin.

Is that a possible cause to all these errors? And yes, how could I fix it?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.