Glib实例学习(0)开始
2015-08-16 00:00
190 查看
1:Glib概述
Glib是一个底层库,她提供了一系列的的数据类型以及关于这些数据的操作,这些数据类型大概包括:
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
2:从“Hello world”开始
鉴于手工指定库相关信息比较麻烦而且容易出错,大部分的发行版Linux 都提供了pkgconfig 工具:
<参考>
http://developer.gimp.org/api/2.0/glib/index.html
Glib是一个底层库,她提供了一系列的的数据类型以及关于这些数据的操作,这些数据类型大概包括:
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
2:从“Hello world”开始
#include <stdio.h> #include <glib.h> int main(int agrc, char **argv) { g_printf("Hello world!\n"); return 0; }
$ gcc -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0 -o hello hello.c $ ./hello
鉴于手工指定库相关信息比较麻烦而且容易出错,大部分的发行版Linux 都提供了pkgconfig 工具:
$ gcc `pkg-config --cflags --libs glib-2.0` -o hello hello.c $ ./hello
<参考>
http://developer.gimp.org/api/2.0/glib/index.html
相关文章推荐
- Glib实例学习(1)单链表
- Glib实例学习(2)双链表
- Glib实例学习(3)哈希表
- Glib实例学习(4)动态数组
- Glib实例学习(5)平衡二叉树
- Glib实例学习(6)双端队列
- Glib实例学习(7)关系/元组
- Glib实例学习(8)系列一(完)
- 吉他 c大调第一把位
- 15个必须知道的 Chrome 开发技巧
- eclipse控制台不显示打印信息的处理方法
- JsonUtil-本人原创
- Web客户端安全性最佳实践
- Perl 中的输入与输出
- getResource的用法对于class和classloader
- rpm与srpm包的区别和安装方法
- 空中网面试题二SynchronousQueue
- SDK学院--棱镜SDK:棱镜SDK 二次验证方案
- php友好格式化时间
- Linux学习笔记(23) Linux备份