From Wikipedia, the free encyclopedia
Jump to: navigation, search
Developer(s) The GNOME Project
Stable release 2.38.2 (November 12, 2013; 5 months ago (2013-11-12)) [±][1]
Development status Active
Written in C
Operating system Cross-platform
Platform Cross-platform
Available in Multilingual
Type Library
License GNU Lesser General Public License
As the GNU C Library serves as a wrapper for Linux kernel system calls, so do the libraries bundled in GLib (GObject, Glib, GModule, GThread and GIO) serve as further wrappers for their specific tasks.

GLib is a bundle of five low-level system libraries written in C used by GNOME.


GLib began as part of the GTK+ project. However, before releasing GTK+ version 2, the project's developers decided to separate non-GUI-specific code from GTK+, thus creating GLib as a separate software bundle. GLib was released as a separate library so other developers, those who did not make use of the GUI-related portions of GTK+, could make use of the non-GUI portions of the library without the overhead of depending on the entire GUI library.

Since GLib is a cross-platform library, applications using it to interface with the operating system are usually portable across different operating systems without major changes.[2]


GLib provides advanced data structures, such as memory chunks, doubly and singly linked lists, hash tables, dynamic strings and string utilities, such as a lexical scanner, string chunks (groups of strings), dynamic arrays, balanced binary trees, N-ary trees, quarks (a two-way association of a string and a unique integer identifier), keyed data lists, relations and tuples. Caches provide memory management.

GLib implements functions that provide threads, thread programming and related facilities such as primitive variable access, mutexes, asynchronous queues, secure memory pools, message passing and logging, hook functions (callback registering) and timers. Also message passing facilities such as byte order conversion and I/O channels.

Some other features of GLib include:

  • standard macros
  • warnings and assertions
  • dynamic loading of modules


GLib package consisted of 5 libraries, but these were all merged into one glib library, and are no longer sustained as stand alone libraries, see the source code:

Similar projects[edit]

Other widget toolkits provide low-level functions and implementations of data structures as well, e.g.:

External links[edit]


  1. ^ glib releases, 
  2. ^ Krause, Andrew (2007). Foundations of GTK+ Development. Expert's Voice in Open Source. Apress. p. 5. ISBN 1-59059-793-1. Retrieved 3 April 2013. "[GLib] provides a cross-platform interface that allows your code to be run on any of its supported operating systems with little to no rewriting of code!" 
  3. ^