1:从github下载源码:git clone https://github.com/GNOME/glib.git ;
2:./autogen.sh to generate the configure
script;
(sudo apt-get install libmount-dev ;)
3:./configure --prefix ~/static/glib/ --enable-static ;
4:make ;
5:make check;
6:make install
编译:
1:gcc -Wall -I ~/static/glib/include/glib-2.0 -I ~/static/glib/lib/glib-2.0/include -c -o keyfile.o keyfile.c;
2:gcc -Wall keyfile.o -L /home/ubuntu/static/glib/lib/ -lglib-2.0 -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -o keyfile ;