现在的位置: 首页我爱Linux>正文
编译安装 mcrypt 错误一例
发表于7年前 我爱Linux 暂无评论 ⁄ 被围观 1,512 次+

在编译安装 mcrypt 出现了错误 ,一下是错误信息

[root@localhost mcrypt-2.6.8]# make
make  all-recursive
make[1]: Entering directory `/root/tools/lamp/mcrypt-2.6.8'
Making all in doc
make[2]: Entering directory `/root/tools/lamp/mcrypt-2.6.8/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/tools/lamp/mcrypt-2.6.8/doc'
Making all in src
make[2]: Entering directory `/root/tools/lamp/mcrypt-2.6.8/src'
gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/usr/local/share/locale\" -I../intl    -g -O2 -I/usr/local/include -Wall -MT extra.o -MD -MP -MF .deps/extra.Tpo -c -o extra.o extra.c
In file included from /usr/local/include/mhash.h:33,
                 from ./defines.h:8,
                 from extra.c:24:
/usr/local/include/mutils.h:27:26: error: mhash_config.h: No such file or directory
extra.c: In function ‘write_file_head’:
extra.c:365: warning: pointer targets in assignment differ in signedness
extra.c: In function ‘test_file_headers’:
extra.c:634: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’
make[2]: *** [extra.o] Error 1
make[2]: Leaving directory `/root/tools/lamp/mcrypt-2.6.8/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/tools/lamp/mcrypt-2.6.8'
make: *** [all] Error 2
 

于是查看 /usr/local/include/mutils.h 第26,27行:

#if defined(HAVE_CONFIG_H)
#include <mhash_config.h>
#endif

到 /usr/local/include/ 目录下一看 没有 mhash_config.h 文件.

解决办法: 从系统中查找 mhash_config.h 将找到的 mhash_config.h 复制到 /usr/local/include/

# locate mhash_config.h
/root/tools/lamp/mhash-0.9.3/mhash_config.h
/root/tools/lamp/mhash-0.9.3/mhash_config.h.in
/usr/include/mutils/mhash_config.h
# cp /usr/include/mutils/mhash_config.h /usr/local/include/

最后make make install

给我留言

留言无头像?