Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

g-ir-scanner fails to generate gir-file

I am trying to generate a .gir-file from a very simple library; it's basically the GObject example from the GLib documentation. When using g-ir-scanner, it fails with the follwing error:

$ g-ir-scanner -I./ --library=foo --library-path=./ --pkg=gobject-2.0 --namespace=Foo -o foo-bar.gir foo-bar.c foo-bar.h
g-ir-scanner: compile: gcc -Wall -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-         linux-gnu/glib-2.0/include -I./ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-  2.0/include -c -o /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.o   /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.c
g-ir-scanner: link: gcc -o /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.o -L. -Wl,-rpath=. -  lfoo -L./ -Wl,--export-dynamic -pthread -lgio-2.0 -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
ERROR: can't resolve libraries to shared libraries: foo

I have really no idea what went wrong. Any ideas?

like image 593
user2018273 Avatar asked Nov 29 '25 02:11

user2018273


1 Answers

This is a bug in g-ir-scanner (https://bugzilla.gnome.org/show_bug.cgi?id=699442). Basically foo-bar does not contain any GObject classes and it has failed. A class is detected by having a function called foo_blah_get_type().

like image 121
Robert Ancell Avatar answered Dec 02 '25 04:12

Robert Ancell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!