# libmcrypttar zxf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8./configure --prefix=/home/felix021/lamp/libmcrypt/makemake install# mhashtar jxf mhash-0.9.9.9.tar.bz2cd mhash-0.9.9.9./configure --prefix=/home/felix021/lamp/mhash/makemake install# mcryptld_library_path=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/lib./configure --prefix=/home/felix021/lamp/mcrypt/ --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt
configure不通过,提示:
checking for mhash_keygen in -lmhash... no
configure: error: you need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/于是专门去找了mhash0.8.18和mhash0.8.15,依然是这个错误。
查了一下mhash_keygen这个函数,在0.8.15/8中是
int mhash_keygen(xxx,xxx,xxx)
在 0.9.9.9 中是
#if defined(prototypes)mutils_error mhash_keygen(keygenid algorithm, ....)#elsemutils_error mhash_keygen();#endif
(mutils_error是typedef的uint32)
而mcrypt的configure里头12114行用来测试的是
char mhash_keygen ();
即使把char改成 mutils_error 也还是不行。
求解。
回复内容: 想自己编译安装php的mcrypt扩展
# libmcrypttar zxf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8./configure --prefix=/home/felix021/lamp/libmcrypt/makemake install# mhashtar jxf mhash-0.9.9.9.tar.bz2cd mhash-0.9.9.9./configure --prefix=/home/felix021/lamp/mhash/makemake install# mcryptld_library_path=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/lib./configure --prefix=/home/felix021/lamp/mcrypt/ --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt
configure不通过,提示:
checking for mhash_keygen in -lmhash... no
configure: error: you need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/于是专门去找了mhash0.8.18和mhash0.8.15,依然是这个错误。
查了一下mhash_keygen这个函数,在0.8.15/8中是
int mhash_keygen(xxx,xxx,xxx)
在 0.9.9.9 中是
#if defined(prototypes)mutils_error mhash_keygen(keygenid algorithm, ....)#elsemutils_error mhash_keygen();#endif
(mutils_error是typedef的uint32)
而mcrypt的configure里头12114行用来测试的是
char mhash_keygen ();
即使把char改成 mutils_error 也还是不行。
求解。
问题解决了,stackoverflow上面的大牛指出,在编译mcrypt之前需要在ldflags中给出-l和-i
export ld_library_path=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/libexport ldflags=-l/home/felix021/lamp/mhash/lib/ -i/home/felix021/lamp/mhash/include/export cflags=-i/home/felix021/lamp/mhash/include/./configure --prefix=/home/felix021/lamp/mcrypt/ --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt
参见 http://stackoverflow.com/questions/63...
你新安装了动态链接库,在mcrypt configure之前执行一下ldconfig试试
直接用yum吧,直接编译源码的话,会有很多库的依赖,在configure的时候并没有处理好
