glib的升级

来源:互联网 发布:炫酷黑客手机源码 编辑:程序博客网 时间:2024/06/05 00:50

转自: http://blog.csdn.net/saint1126/article/details/6147169

在写蜡笔链接业务的时候和mecacheq的分布式的时候都用到了glib库的hashtable数据结构, 使用了遍历其中所有的键值g_hash_table_get_keys()函数,该函数是glib2.12以后才支持, 服务器上的是glib2.6,版本比较低了,所以打算升级下,

[ruby] view plain copy
  1.  wget http://ftp.gnome.org/pub/GNOME/sources/glib/2.26/glib-2.26.1.tar.gz  
  2. tar xvzf glib-2.26.1.tar.gz   
  3. cd glib-2.26.1  
  4. ./configure --prefix=/usr/local/  
  5. export LD_LIBRARY_PATH=/usr/local/lib  
  6. export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig  
  7. make  
  8. make uninstall  
  9. make install   

这时可能会出现

[c-sharp] view plain copy
  1. make[4]: Leaving directory `/root/Desktop/glib-2.26.0/gio'  
  2. Making all in tests  
  3. make[4]: Entering directory `/root/Desktop/glib-2.26.0/gio/tests'  
  4. /usr/bin/msgfmt -o test.mo ./de.po; /  
  5.         /bin/mkdir -p de/LC_MESSAGES; /  
  6.         cp -f test.mo de/LC_MESSAGES  
  7. ./de.po:15: 关键字“msgctxt”未知  
  8. ./de.po:15:8: parse error  
  9. /usr/bin/msgfmt: 发现 2 处致命错误  

需要升级gettext package的库,操作如下:

[c-sharp] view plain copy
  1.  wget http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz  
  2. tar xvzf gettext-0.18.1.1.tar.gz   
  3. cd gettext-0.18.1.1  
  4. ./configure  
  5. make  
  6. make install  
  7. ldconfig  

然后在执行升级glib的操作即可.