[Trilinos-Users] Workaround for odd bug involving /usr/include/c++/4.0.0/cstdlib:110: error: '::malloc' has not been declared on OS X.4 Mac Pro

Doug Reeder dlr at rain.org
Fri Nov 17 19:31:54 MST 2006


Aron,

Generally on a mac malloc.h won't get included because it is in /usr/ 
include/malloc instead of /usr/include. You may have to add a -DOSX  
to the CFLAGS and add an #ifdef OSX with an #include <malloc/malloc.h>

Doug Reeder
On Nov 17, 2006, at 6:02 PM, Aron Ahmadia wrote:

> Dear all,
>
> I've encountered a strange bug in building the Trilinos packages on  
> my machine.  I have not yet tracked down the source of the bug, I  
> am as likely to blame it on a compiler misconfiguration or a broken  
> set of system includes as the Trilinos package, which is why I have  
> not yet submitted it as a bug report.
>
> Regardless, the error is preventing a build of the triutils  
> package, and shows up as this:
>
> /usr/include/c++/4.0.0/cstdlib:110: error: '::malloc' has not been  
> declared
>
> The only thing in my knowledge that could cause this is if the  
> function malloc is not in global scope.  This would mean that the  
> previous definition of malloc in stdlib.h did not occur for one  
> reason or another.
>
> A quick workaround for this problem is to add the following  
> directive to Tri_configs.h
>
> #include <memory>
>
> Prior to
>
> #include <cstdlib>
>
> More later.
>
> Thanks,
> ~A
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users




More information about the Trilinos-Users mailing list