博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Glib相關
阅读量:4286 次
发布时间:2019-05-27

本文共 996 字,大约阅读时间需要 3 分钟。

Compiling GLib Applications

 

 

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/

你可能感兴趣的文章
.Net编译器Roslyn(一)
查看>>
C# 6.0新特性整理
查看>>
Sublime Text插件之Css3
查看>>
查看当前Git工具的版本
查看>>
AngularJS路由之ui-router(三)
查看>>
Sublime Text插件之HTML-CSS-JS Prettify
查看>>
Sublime Text插件之JavaScript Completions
查看>>
C#编码规范整理
查看>>
C#Nullable<T>可空的值类型,C#中的?使用整理
查看>>
EntityFramework中JSON序列化循环引用----JavaScriptSerializer
查看>>
EntiryFramework中事务操作实例
查看>>
删除github上的远程分支
查看>>
Visual Studio Code 1.8 发布
查看>>
SQL Server Management Studio 2016 (SSMS)
查看>>
EF中Sum()异常:到值类型“System.Decimal”的强制转换失败,因为具体化值为 null。
查看>>
Visual Studio Code插件之Atom One Dark Syntax Theme
查看>>
EntiryFramework中事务操作(二)TransactionScope
查看>>
EF获取非跟踪数据之DBSet.AsNoTracking()
查看>>
关于EF6.0整理
查看>>
C# using 关键字使用整理
查看>>