CentOS 6.5 安装gmime 2.6.20 (一)

来源:互联网 发布:网络套餐对比 编辑:程序博客网 时间:2024/05/22 14:16

虽然gmime-2.6.20 configure中标明的对glib的依赖版本是“GLIB - version >= 2.18.0”,系统默认的Glib版本是2.28.8。

实际编译过程中,会报错:

../gmime/.libs/libgmime-2.6.so: undefined reference to `g_mutex_init'
../gmime/.libs/libgmime-2.6.so: undefined reference to `g_mutex_clear'

是由于glib版本过低,需要安装高版本glib

GLib 依赖 libffi

1. 安装libffi-3.2.1 到/usr/local目录下。

设置pkg的查找路径,以便Glib编译时找到libffi.

export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig


2.安装glib-2.50

需要安装libffi和libmount, 没有找到合适的libmount版本。

configure: error: *** Could not find libmount

找不到解决办法,

换成glib-2.48.2 需要pcre支持

checking for PCRE... noconfigure: error: Package requirements (libpcre >= 8.13) were not met:No package 'libpcre' found

5.安装pcre-8.39

 第一次直接./configure、make、make install

结果编译Glib时会报错:

checking for PCRE... yeschecking for Unicode support in PCRE... noconfigure: error: *** The system-supplied PCRE does not support Unicode properties or UTF-8.
因此重新编译pcre:
./configure --prefix=/usr --docdir=/usr/share/doc/pcre-8.39 --libdir=/usr/lib64 --enable-unicode-properties --enable-pcre16 --enable-pcre32 --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-pcretest-libreadline --disable-static --enable-utf8

6.编译Glib-2.48.2

 为了避免升级Glib带来不可预测的错误,没有覆盖原先的Glib目录,安装到独立地目录中。

./configure --prefix=/usr/local


后来觉得实在太麻烦了,每次使用都需要指明用的那个版本,就把新装的卸载后,重新安装到/usr目录下,把旧版本删除了。


7.安装Gmime-2.6.20

默认仍然会找到旧的Glib库,需要把旧版本对应的pkgconfig删掉

mv /usr/lib64/pkgconfig/glib-2.0.pc{,.old}
修改LD_LIBRARY_PATH 让make找到新安装的glib库

export LD_LIBRARY_PATH=/usr/local/lib

参考:

http://www.cnblogs.com/etangyushan/p/3938480.html

http://www.cnblogs.com/pcat/p/5520317.html

0 0
原创粉丝点击