Questions tagged [glib]

GLib is a general-purpose and cross-platform utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on.

GLib is a general-purpose and cross-platform utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on.

For many applications, C with GLib and GObject is an alternative to C++ with STL. It works on many UNIX-like platforms, Windows, OS/2 and BeOS. GLib is released under the GNU Library General Public License (GNU LGPL).

The GLib reference manual can be found at the GNOME developer site.

1529 questions
119
votes
5 answers

GLib compile error (ffi.h), but libffi is installed

After a succesful configure, make exits with snipped gclosure.c:29:17: fatal error: ffi.h: No such file or directory compilation terminated. I have libffi installed, and locate ffi.h…
deltaluca
  • 1,652
  • 2
  • 10
  • 9
89
votes
5 answers

What's the significance of a C function declaration in parentheses apparently forever calling itself?

In gatomic.c of glib there are several function declarations that look like this: gboolean (g_atomic_int_compare_and_exchange_full) (gint *atomic, gint oldval, gint…
Andreas
  • 9,245
  • 9
  • 49
  • 97
51
votes
6 answers

Material to learn GObject and Glib

I am comfortable with C. but need to learn GObject and Glib for gstreamer. All i found on net is Gobject reference manual. Its good but looking for tutorial for Gobject/Glib as the main focus is on gstreamer. So pls share any other resources to…
rahijain
  • 885
  • 1
  • 8
  • 10
50
votes
17 answers

Does using large libraries inherently make slower code?

I have a psychological tic which makes me reluctant to use large libraries (like GLib or Boost) in lower-level languages like C and C++. In my mind, I think: Well, this library has thousands of man hours put into it, and it's been created by…
Gavin
  • 9,855
  • 7
  • 49
  • 61
49
votes
1 answer

glibconfig.h no such file or directory

I just installed glib in Raspbian(Debian version). I want to read a config file using glib. I am trying to write a C application in Codeblocks and I use the header #include But I have an error in gtypes.h fatal error:glibconfig.h No such…
dali1985
  • 3,263
  • 13
  • 49
  • 68
45
votes
5 answers

Why can't I build a "hello world" for glib?

So here's the world's simplest glib program: #include I try to compile it with gcc test.c and I get: test.c:1:18: error: glib.h: No such file or directory So I make sure that I have the right packages: # dpkg -l | grep libglib ii …
mike
  • 46,876
  • 44
  • 102
  • 112
41
votes
4 answers

Sublime Text on Ubuntu 14.04 - Keeps attempting to remove it

Sublime & from Terminal, opens a Sublime Text window, but keep getting this message: (sublime: 6476): GLib-CRITICAL **; Source ID 1982 was not found when attempting to remove it. The Source ID keeps changing. Using Ubuntu 14.04. Any ideas what…
Janeway
  • 511
  • 1
  • 4
  • 5
41
votes
2 answers

What exactly are GLib and GObject?

I have been looking into the source code of python-mpdor and it mentions that it is gobject-based, for easy event handling (in the high-level client class). Can someone explain to me in simple terms what exactly are Glib and GObject and how do…
RanRag
  • 48,359
  • 38
  • 114
  • 167
40
votes
2 answers

glibc, glib and gnulib

what are differences in the strength and features in gnulib glib and glibc Thanks!
Tim
  • 1
  • 141
  • 372
  • 590
39
votes
3 answers

Installing glib in non-standard prefix fails

I'm trying to install glib in a non-standard prefix but I get the following when running make install: /bin/sh ../libtool --mode=install /usr/bin/install -c libgthread-2.0.la '/root/build/lib' libtool: install: error: cannot install…
Elektito
  • 3,863
  • 8
  • 42
  • 72
31
votes
7 answers

Why use GLib functions?

While programming in C and GTK+, why is it "better" to use g_strdup_printf, g_free, g_strcmp0 etc... and fellow GLib functions?
Zenet
  • 6,961
  • 13
  • 38
  • 45
29
votes
4 answers

Linux glib needs pkg-config and pkg-config needs glib?

I try to install udev. And udev gives me an error during the ./configure --exists: command not found configure: error: pkg-config and "glib-2.0 >= 2.16" not found, please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass…
Peter
  • 1,629
  • 2
  • 25
  • 45
26
votes
2 answers

How do I get GDB to break on a GLib assertion failure?

Somewhere in a mass of code that I did not write (but I am trying to debug), an assertion fails in the GLib library: (process:31987): GLib-CRITICAL **: g_hash_table_lookup: assertion `hash_table != NULL' failed However, GDB and the code keeps on…
gnychis
  • 7,289
  • 18
  • 75
  • 113
26
votes
1 answer

Gettext message catalogues from virtual dir within PYZ for GtkBuilder widgets

Is there an established approach to embed gettext locale/xy/LC_MESSAGES/* in a PYZ bundle? Specifically to have Gtks automatic widget translation pick them up from within the ZIP archive. For other embedded resources pkgutil.get_deta or…
mario
  • 144,265
  • 20
  • 237
  • 291
24
votes
2 answers

Valgrind reports memory 'possibly lost' when using glib data types

I'm developing a library using a number of glib datastructures (GHashTable, GSList etc.). I've been checking my code frequently for memory leaks using valgrind. Most of the issues valgrind points out are quite easy to fix, however there's a few that…
tomger
  • 539
  • 8
  • 16
1
2 3
99 100