Mac compiler MCrypt error malloc.h not present

Source: Internet
Author: User
Tags mcrypt

When compiling mcrypt under Mac, I always get an error.

First hint

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: "Need at least libmhash 0.8.15 to compile".

http://mhash.sf.net/"

It's done by adding environment variables.

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


Then the hint file cannot be found

Fix it by modifying the source code


#include <malloc.h>

Switch

#include <stdlib.h>

This article is from the "Ogo notes" blog, so be sure to keep this source http://zhixinhu.blog.51cto.com/3132199/1739369

Mac compiler MCrypt error malloc.h not present

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.