Mac编译mcrypt报错malloc.h不存在

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mac编译mcrypt报错malloc.h不存在相关的知识,希望对你有一定的参考价值。

mac下编译mcrypt的时候总是报错,

起初提示

rm: conftest.dSYM: is a directory

checking if gcc supports -fno-rtti -fno-exceptions... yes

checking for gcc option to produce PIC... -fno-common -DPIC

checking if gcc PIC flag -fno-common -DPIC works... yes

checking if gcc static flag -static works... no

checking if gcc supports -c -o file.o... yes

checking if gcc supports -c -o file.o... (cached) yes

checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes

checking dynamic linker characteristics... darwin15.3.0 dyld

checking how to hardcode library paths into programs... immediate

checking whether stripping libraries is possible... yes

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... yes

checking whether to build static libraries... yes

checking for gcc... (cached) gcc

checking whether we are using the GNU C compiler... (cached) yes

checking whether gcc accepts -g... (cached) yes

checking for gcc option to accept ISO C89... (cached) none needed

checking dependency style of gcc... (cached) gcc3

checking for libmcrypt-config... /usr/local/mnmp/libmcrypt//bin/libmcrypt-config

checking for libmcrypt - version >= 2.5.0... yes

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/"

通过增加环境变量搞定了

export LD_LIBRARY_PATH=/usr/local/mnmp/libmcrypt/lib/:/usr/local/mnmp/mhash/lib/

export LDFLAGS="-L/usr/local/mnmp/mhash/lib/ -I/usr/local/mnmp/mhash/include"

export CFLAGS="-I/usr/local/mnmp/mhash/include/"


然后提示文件找不到

通过修改源码搞定


#include <malloc.h>

改为

#include <stdlib.h>

本文出自 “大胡的笔记” 博客,请务必保留此出处http://zhixinhu.blog.51cto.com/3132199/1739369

以上是关于Mac编译mcrypt报错malloc.h不存在的主要内容,如果未能解决你的问题,请参考以下文章

编译mcrypt时,报错:You need at least libmhash 0.8.15

解决php编译报错configure: error: mcrypt.h not found. Please reinstall libmcrypt.

PHP编译安装报错:configure: error: mcrypt.h not found. Please reinstall libmcrypt

解决php编译报错configure: error: mcrypt.h not found. Please reinstall libmcrypt.

PHP mcrypt 未正确编译

在 Mac OS X 10.5.8 上为 PHP 安装 Mcrypt 扩展