本文共 996 字,大约阅读时间需要 3 分钟。
Here's a tutorial, a little old but still applicable:
Here's a tutorial on the GObject part of GLib:
Also check out the excellent book 'Foundations of GTK Development' by Andrew Krause, it has a chapter on GLib:
---------------------------------------------------------------------------------------------------------------
Glib compiler出現 test.c:2:18: fatal error: glib.h: No such file or directory
安裝下面package可以解決
$sudo apt-get install libglib2.0-dev
----------------------------------------------------------------------------------------------------------------
Glib Helloworld example code
#include#include int main(int argc, char** argv) { GList* list = NULL; list = g_list_append(list, "Hello world!"); char* str = g_list_first(list)->data; printf("The first item is '%s'\n", str); return 0;}
output:The first item is 'Hello world!'
How to compile
$gcc test.c -Wall -o test `pkg-config --cflags --libs glib-2.0`
转载地址:http://orsgi.baihongyu.com/