标签:.gz 应该 clu 依赖库 lib class pre 打印 oca
libffi-3.0.0.tar.gz glib-2.40.0.tar.xz
tar xf libffi-3.0.0.tar.gz cd libffi-3.0.0 ./configure make make install
export LIBFFI_CFLAGS=-I/usr/local/lib/libffi-3.0.0/include export LIBFFI_LIBS=/usr/local/lib/libffi.la export C_INCLUDE_PATH=/usr/local/lib/libffi-3.0.0/include/
configure 配置选项 --enable-debug=no 选项:默认是mini模式,在release的时候应该使用该选项 --disable-included-printf 选项:这个选项要谨慎使用,可能会造成某些 printf 家族的函数不能使用 tar xf glib-2.40.0.tar.xz cd glib-2.40.0 ./configure --enable-debug=no make make install
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
#include <stdio.h> #include <glib.h> int main(int argc, char *argv[]) { GString *teststr = NULL; teststr = g_string_new("1234"); printf ("str is:%s\n", teststr->str); printf ("len is:%d\n", teststr->len); g_string_free (teststr, TRUE); teststr = NULL; g_return_val_if_fail (teststr, NULL); return 0; }
gcc -I /usr/local/include/glib-2.0/ -I /usr/local/lib/glib-2.0/include/ -L/usr/local/lib -lglib-2.0
./a.out
gcc -I /usr/local/include/glib-2.0/ -I /usr/local/lib/glib-2.0/include/ -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -lglib-2.0
标签:.gz 应该 clu 依赖库 lib class pre 打印 oca
原文地址:http://www.cnblogs.com/etangyushan/p/6710168.html