码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2016-01-28 07:11:00      阅读:610      评论:0      收藏:0      [点我收藏+]

标签:produce   option   whether   

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不存在

标签:produce   option   whether   

原文地址:http://zhixinhu.blog.51cto.com/3132199/1739369

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!