编译mcrypt出错,mhash怎么都对不上(已解决)
想自己编译安装php的mcrypt扩展
# libmcrypt tar zxf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8 ./configure --prefix=/home/felix021/lamp/libmcrypt/ make make install # mhash tar jxf mhash-0.9.9.9.tar.bz2 cd mhash-0.9.9.9 ./configure --prefix=/home/felix021/lamp/mhash/ make make install # mcrypt LD_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, ....) #else mutils_error mhash_keygen(); #endif
(mutils_error是typedef的uint32)
而mcrypt的configure里头12114行用来测试的是
char mhash_keygen ();
即使把char改成 mutils_error 也还是不行。
求解。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这样写也可以
把2个路径都写在LDFLAGS变量里面也能读出来,不过分开写对于初学者更容易理解
僵尸?
问题?
重新烙个印。最好在安装libmcrypt和mhash就指定安装路径。这样在后面设置LD_LIBRARY_PATH 、LDFLAGS和CFLAGS就不会找错了。
直接用yum吧,直接编译源码的话,会有很多库的依赖,在configure的时候并没有处理好
你新安装了动态链接库,在mcrypt configure之前执行一下
ldconfig
试试问题解决了,StackOverflow上面的大牛指出,在编译mcrypt之前需要在LDFLAGS中给出-L和-I
参见 http://stackoverflow.com/questions/63...