GlibGLib w wikipediii
Zastosowania GLib definiuje szereg typówstackoverflow question: why-does-glib-redefine-types, struktur danych i powiązanych z nimi operacji:Manage C data using the GLib collections by Tom Copeland Published June 28, 2005 Memory chunks Doubly-linked lists Singly-linked lists Hash tables Strings (which can grow dynamically) String chunks (groups of strings) Arrays (which can grow in size as elements are added) Balanced binary trees N-ary trees Quarks (a two-way association of a string and a unique integer identifier) Keyed data lists (lists of data elements accessible by a string or integer id) Relations and tuples (tables of data which can be indexed on any number of fields) Caches
instalacja
sudo apt-get install libglib2.0-dev
wersja
sudo dpkg -l | grep libglib
ldconfig -v | grep libglib
za pomocą pkg-config
pkg-config --list-all|grep glib
Przykładowy wynik:
gio-2.0 GIO - glib I/O library gio-unix-2.0 GIO unix specific APIs - unix specific headers for glib I/O library glib-2.0 GLib - C Utility Library glib-sharp-2.0 GLib - GLib
ldd --version
Przykładowy wynik:
ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35 Prawa autorskie © 2022 Free Software Foundation, Inc. To oprogramowanie jest darmowe; warunki kopiowania są opisane w źródłach. Autorzy nie dają ŻADNYCH gwarancji, w tym również gwarancji MOŻLIWOŚCI SPRZEDAŻY lub PRZYDATNOŚCI DO KONKRETNYCH ZASTOSOWAŃ. Autorami są Roland McGrath i Ulrich Drepper.
Programy
pierwszy Pierwszy , najprostszy program Compiling GLib C Programs by CodeNerd
// https://prognotes.net/2016/10/compiling-glib-c-programs/ #include
int main(void) { g_print("Hello, world!\n"); return 0; }
kompilacja z użyciem pkg-config ( przekazujemy osobno cflags i libs):stackoverflow question: why-cant-i-build-a-hello-world-for-glib
gcc -Wall -o test `pkg-config --cflags glib-2.0` test.c `pkg-config --libs glib-2.0`
Pomoc
offline
sudo apt-get install libglib2.0-doc sudo apt-get install devhelp
online stackoverflow questions tagged glib
Źródła