Error while building gobject introspection

While compiling gobject introspection I receive this error message:

make[2]: *** No rule to make target `/glib-2.0/include/glibconfig.h', needed by `GLib-2.0.gir'.  Stop.

My configure:

CPPFLAGS=-I/media/34GB/Arquivos-de-Programas-Linux/Python-2.6/include/python2.6/ ./configure --prefix=/media/34GB/Arquivos-de-Programas-Linux/Gobject-introspection-1.29.0 PKG_CONFIG_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pixman-0.18.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Fontconfig-2.8.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Freetype-2.2.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Png-1.2.14/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xrender-0.9.0.2/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/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/FFI-3.3/lib/pkgconfig/

Any suggestions on how to fix the source of this error message?

I searched for GLib-2.0.gir and could not locate it anywhere. Could this nonexistence be the source of the error? If yes, what could make this file to not be generate?

glibconfig.h is the only file on …/glib-2.0/include/

Doing a grep glibconfig.h Makefile returns a:

$(GLIB_LIBDIR)/glib-2.0/include/glibconfig.h \

and doing the same with GLIB_LIBDIR returns:

GLIB_LIBDIR = $(shell pkg-config --variable=libdir glib-2.0)
-I$(GLIB_LIBDIR)/glib-2.0/include
$(GLIB_LIBDIR)/glib-2.0/include/glibconfig.h \

Perhaps that’s the cause of nonexistence of Glib-2.0.gir? I don’t know. If yes, there is a way to check this variable’s value?

If someone has an idea or knows where I can find someone with knowledge about it, please tell me, this is essential to compile gobject, and hence gtk 3.0 and the millions of software that depends on it

GLib-2.0.gir, like GObject-2.0.gir and Gio-2.0.gir, is generated by gobject-introspection: https://gitlab.gnome.org/GNOME/gobject-introspection/-/blob/master/gir/meson.build#L99-126

If the error is:

No rule to make target `/glib-2.0/include/glibconfig.h'

it means you’re missing the libdir from your environment, because that should be /usr/lib/glib-2.0/include/glibconfig.h (with “/usr/lib” being the library directory where libglib-2.0.so.* is installed).

As I told you already on GitLab, “Gobject-introspection-1.29.0” is a development snapshot released 10+ years ago. I don’t know why you’re trying to build development snapshots that old, but things will likely be broken.

Additionally, and I say this with as delicately as I can: if you’re really not knowledgeable in how to build things from scratch, trying to “learn by throwing things in” will inevitably lead to pain. I don’t know what you’re trying to achieve, here, but coming up with questions like the ones you have been asking is really wasting your time, and the time of people that may be able to help you.

PKG_CONFIG_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pixman-0.18.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Fontconfig-2.8.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Freetype-2.2.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Png-1.2.14/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xrender-0.9.0.2/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/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/FFI-3.3/lib/pkgconfig/

Also, I don’t know why you’re trying to install each piece of software you build into a separate install prefix, but suffice to say the chances of this working are extremely slim even if you do somehow manage to get it to build. Instead of being creative, try just installing things normally.

it means you’re missing the libdir from your environment, because that should be /usr/lib/glib-2.0/include/glibconfig.h (with “/usr/lib” being the library directory where libglib-2.0.so.* is installed).

Ok, libglib-2.0.so is not in /usr/lib, and yes in /media/34GB/Glib-2.48/lib/. If libdir is the culprit, what do I have to change to make gobject introspection to set libdir to it?

Keep in mind that I am doing:

PKG_CONFIG_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.48.0/lib/pkgconfig/

so it should already be correct.

Hopefully there is something more than a risk system wide installing of Glib that I am unsure enough about if that will work to try to avoid it.

I decided to temporarily install glib-2.48 on /usr/local to see if that configure/Makefile bug would vanish. So I installed it on /usr/local and tried to build gobject again.

This time I received:

GISCAN GLib-2.0.gir
GICOMP gir/DBus-1.0.gir
/usr/local/include/glib-2.0/glib/glib-autocleanups.h:41: syntax error, unexpected typedef-name, expecting identifier or ‘(’ in ‘typedef GAsyncQueue GAsyncQueue_autoptr; static __inline void glib_autoptr_cleanup_GAsyncQueue (GAsyncQueue **_ptr) { if (_ptr) (g_async_queue_unref) (_ptr); }’ at ‘GAsyncQueue_autoptr’
/usr/local/include/glib-2.0/glib/glib-autocleanups.h:42: syntax error, unexpected typedef-name, expecting identifier or ‘(’ in 'typedef GBookmarkFile GBookmarkFile_autoptr; static __inline void glib_autoptr_cleanup_GBookmarkFile (GBookmarkFile **_ptr) { if (_ptr) (g_bookmark_file_free) (
_ptr); }’ at ‘GBookmarkFile_autopt
LOTS of similar “syntax error messages”



/usr/local/include/glib-2.0/glib/glib-autocleanups.h:88: syntax error, unexpected typedef-name, expecting identifier or ‘(’ in ‘typedef GVariantType GVariantType_autoptr; static __inline void glib_autoptr_cleanup_GVariantType (GVariantType **_ptr) { if (_ptr) (g_variant_type_free) (*_ptr); }’ at ‘GVariantType_autoptr’
make[2]: *** [gir/DBus-1.0.typelib] Error 127
make[2]: *** Waiting for unfinished jobs…
/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0.c: In function ‘main’:
/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0.c:575:3: warning: ‘g_thread_init’ is deprecated (declared at /usr/local/include/glib-2.0/glib/deprecated/gthread.h:265) [-Wdeprecated-declarations]
if (!g_thread_supported ()) g_thread_init (NULL);
^
/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0.c:576:3: warning: ‘g_type_init’ is deprecated (declared at /usr/local/include/glib-2.0/gobject/gtype.h:681) [-Wdeprecated-declarations]
g_type_init ();
^
/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0.c: At top level:
/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0.c:678:3: warning: ‘g_variant_parser_get_error_quark’ is deprecated (declared at /media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0.c:663): Use ‘g_variant_parse_error_quark’ instead [-Wdeprecated-declarations]
g_variant_parser_get_error_quark,
^
/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0: symbol lookup error: /media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0: undefined symbol: g_bytes_get_type
Command ‘[’/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/GLib-2.0’, ‘–introspect-dump=/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/functions.txt,/media/34GB/Arquivos-de-Programas-Linux/gobject-introspection-1.29.17/tmp-introspect1flBl1/dump.xml’]’ returned non-zero exit status 127
make[2]: *** [GLib-2.0.gir] Error 1

Then I tried gobject 1.39.90

This time I received:

CCLD g-ir-generate
GISCAN GLib-2.0.gir
Traceback (most recent call last):
File “./g-ir-scanner”, line 44, in
from giscanner.scannermain import scanner_main
File “./giscanner/scannermain.py”, line 35, in
from giscanner.dumper import compile_introspection_binary
File “./giscanner/dumper.py”, line 28, in
from .gdumpparser import IntrospectionBinary
File “./giscanner/gdumpparser.py”, line 31, in
from .transformer import TransformerException
File “./giscanner/transformer.py”, line 27, in
from .girparser import GIRParser
File “./giscanner/girparser.py”, line 26, in
from .girwriter import COMPATIBLE_GIR_VERSION
File “./giscanner/girwriter.py”, line 25, in
from .xmlwriter import XMLWriter
File “./giscanner/xmlwriter.py”, line 34, in
from _giscanner import collect_attributes
File “./giscanner/libtoolimporter.py”, line 66, in load_module
mod = imp.load_module(name, open(realpath), realpath, (extension, ‘rb’, 3))
ImportError: ./.libs/_giscanner.so: undefined symbol: g_hash_table_add
make[2]: *** [GLib-2.0.gir] Error 1

I am open to suggestions on how to solve any two problems.

P.S:

I issued a nm -S .libs/_giscanner.so | grep g_hash_table_add

and it returned: U g_hash_table_add (no numbers before it)

That is still a rather old (and unsupported) version, dare I ask what compiler your using?

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