Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rating: Thread Rating: 165 votes, 4.99 average. Display Modes
Old 04-02-2002, 08:30 PM   #1
leighosx
Prospect
 
Join Date: Apr 2002
Posts: 12
Where is "malloc.h"?

Hi All,

I'm trying to compile Internet Junkbuster under 10.1.3 and everything compiles fine except the following:

[dhcp2:/usr/local/ijb20] leigh% make
cc -I. -DREGEX -DSTDC_HEADERS -DHAVE_STRING -g -c -o loaders.o loaders.c
loaders.c:11: header file 'malloc.h' not found
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
make: *** [loaders.o] Error 1


I think "malloc" is a standard function so the header file must be somewhere. Where is it and how would I set some path variable so the compiler could find it?

Thanks.

**Leigh

Last edited by leighosx; 04-02-2002 at 08:33 PM.
leighosx is offline   Reply With Quote
Old 04-02-2002, 08:53 PM   #2
Dr.Evil
Triple-A Player
 
Join Date: Mar 2002
Location: Denver, CO
Posts: 63
/usr/include/sys

/usr/include/sys/malloc.h is the file you're looking for. As for telling the build process where to find it, that's a little trickier, since it can change from makefile to makefile. Is there a configure script for the package? If so, did you run it?
Dr.Evil is offline   Reply With Quote
Old 04-02-2002, 10:11 PM   #3
leighosx
Prospect
 
Join Date: Apr 2002
Posts: 12
The file is in /usr/include/sys/. There is no configure script and there is nothing in the Makefile about include paths.

Here's the Makefile with some commented-out stuff for Win, OS/2, BeOS, etc. omitted:

REGEX = -DREGEX

DEFAULT_CFLAGS = -I. $(REGEX) -DSTDC_HEADERS -DHAVE_STRING

PROG = junkbuster
O = o
RM = rm -f
MORE_CFLAGS = -g

# use this for BSD/OS 3.0
#CC=shlicc2

CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)

OBJS = jcc.$(O) parsers.$(O) filters.$(O) loaders.$(O) bind.$(O) conn.$(O) \
encode.$(O) ssplit.$(O) socks4.$(O) acl.$(O) gnu_regex.$(O) win32.$(O)

$(PROG): $(OBJS)
$(CC) $(CFLAGS) -o $(PROG) $(OBJS) $(LDFLAGS)

clean:
$(RM) a.out core *.o *.obj

clobber: clean
$(RM) junkbuster junkbuster.xMAP junkbstr.exe *.pdb *.lib *.exp
leighosx is offline   Reply With Quote
Old 04-02-2002, 10:18 PM   #4
blb
All Star
 
Join Date: Jan 2002
Location: CO, USA
Posts: 908
Actually, you shouldn't need malloc.h at all, it's obsolete; including stdlib.h should take care of what malloc.h used to handle. Basically, just remove it, or #if it out
Code:
#if !defined(__APPLE__)
#include <malloc.h>
#endif
blb is offline   Reply With Quote
Old 04-03-2002, 07:43 AM   #5
leighosx
Prospect
 
Join Date: Apr 2002
Posts: 12
Quote:
Originally posted by blb
Actually, you shouldn't need malloc.h at all, it's obsolete; including stdlib.h should take care of what malloc.h used to handle. Basically, just remove it, or #if it out
Code:
#if !defined(__APPLE__)
#include <malloc.h>
#endif

That worked! The include for stdlib.h was in the file ahead of malloc.h so I just commented out malloc.h and it's now up an running.

Thanks a lot!

**Leigh
leighosx is offline   Reply With Quote
Old 04-07-2002, 06:49 AM   #6
WillyT
Major Leaguer
 
Join Date: Jan 2002
Location: Midwest Not quite Normal
Posts: 416
fink

Leigh

Junkbusters is available on fink in the unstable section. But I know its sometimes more fun to DIY.

Willy
WillyT is offline   Reply With Quote
Old 04-07-2002, 08:39 AM   #7
leighosx
Prospect
 
Join Date: Apr 2002
Posts: 12
Hi Willy,

What's the URL for fink?

**Leigh
leighosx is offline   Reply With Quote
Old 04-07-2002, 10:28 AM   #8
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
leighosx,

fink download at:

http://fink.sourceforge.net/download/index.php

-----------------------------
Package junkbuster

In 0.3.2a-stable: *** not present
In current-stable: *** not present
In current-unstable: *** Version 2.0.2-1

Description: *** The Internet Junkbuster Proxy (TM)

The Internet Junkbuster Proxy (TM) blocks unwanted banner ads and protects your privacy from cookies and other threats.

------------------------------

Cheers...
sao is offline   Reply With Quote
Old 04-07-2002, 09:41 PM   #9
leighosx
Prospect
 
Join Date: Apr 2002
Posts: 12
Hi Willy & sao,

Thanks to you both, I've got junkbuster running!

And thanks for letting me know about fink--what a great resource.

This is the net at its best!

**Leigh
leighosx is offline   Reply With Quote
Old 11-08-2008, 12:00 PM   #10
daeley
Prospect
 
Join Date: Jan 2002
Posts: 2
Well, it's been over six years since the last message in this topic, but I was googling for info and ran across this near the top of the results. Just in case any other googlers come here in the future, I though I'd post what I wound up doing to fix the malloc.h issue on Mac OS X Leopard.

I was trying to compile the Word War vi game and got the same "can't find malloc.h" message. Basically, it was expecting it to be in the /usr/include directory, when it was actually in the /usr/include/malloc directory.

So on any lines where it says

Code:
#include <malloc.h>
change it to

Code:
#include <malloc/malloc.h>
It was in multiple files for wordwarvi, so you might want to grep for "malloch.h" in your directory just to make sure you find all the instances you need to change.

More info here: http://www.celsius1414.com/node/1793
daeley is offline   Reply With Quote
Old 10-19-2010, 03:21 PM   #11
rwg
Guest
 
Posts: n/a
Chaps,

Another two winters fly by and another googler stumbles upon the post.

Here's my alternative malloc.h workaround to get the Cloudera Hadoop User Experience flying...

sudo ln -s /usr/include/malloc/malloc.h /usr/include/malloc.h

It's a bit cleaner than hacking at the .c files
  Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:52 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.