error: malloc.h: No such file or directory

Apprentice
Posts: 18
Joined: 2006.12
Post: #1
error: malloc.h: No such file or directory

i tryed to #include <malloc.h> in order to use malloc to create a pseudo array. does xcode even have this library? can i dl it somewhere and use it? or does malloc.h a different name in xcode?
Quote this message in a reply
Apprentice
Posts: 18
Joined: 2006.12
Post: #2
nvm i found out that malloc was placed inside stdlib.h Smile oh well. forgetting to go to google first = my moment of stupid. Rasp
Quote this message in a reply
Member
Posts: 53
Joined: 2006.10
Post: #3
I did this in one of my projects I'm working on and it works.

#ifdef __WXMAC__
#include "sys/malloc.h" // mac os x
#else
#include "malloc.h" // linux, windows
#endif

If you don't use wxWidgets maybe change WXMAC to just MAC?
( I program for mac/linux/windows so I care not only about just for mac. )
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Malloc() Struct with NSString Inside? Graphic Ace 3 4,697 Jan 26, 2010 05:32 PM
Last Post: cmiller