These errors are stumping me. There seems to be a problem with cstdlib and/or stdlib.h.
Has anyone seen these types of errors before
I am using Visual Studio 2005.
Error 47 error C2873: 'realloc' : symbol cannot be used in a using-declaration c:\program files\microsoft visual studio 8\vc\include\cstdlib 26
Error 45 error C2873: 'malloc' : symbol cannot be used in a using-declaration c:\program files\microsoft visual studio 8\vc\include\cstdlib 24
Error 43 error C2873: 'free' : symbol cannot be used in a using-declaration c:\program files\microsoft visual studio 8\vc\include\cstdlib 23
Error 41 error C2873: 'calloc' : symbol cannot be used in a using-declaration c:\program files\microsoft visual studio 8\vc\include\cstdlib 22
Error 27 error C2733: second C linkage of overloaded function '_recalloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 596
Error 25 error C2733: second C linkage of overloaded function '_realloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 595
Error 23 error C2733: second C linkage of overloaded function '_malloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 594
Error 21 error C2733: second C linkage of overloaded function '_free_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 593
Error 17 error C2733: second C linkage of overloaded function '_dupenv_s_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 488
Error 19 error C2733: second C linkage of overloaded function '_calloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 592
Error 35 error C2733: second C linkage of overloaded function '_aligned_recalloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 601
Error 33 error C2733: second C linkage of overloaded function '_aligned_realloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 600
Error 39 error C2733: second C linkage of overloaded function '_aligned_offset_recalloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 603
Error 37 error C2733: second C linkage of overloaded function '_aligned_offset_realloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 602
Error 31 error C2733: second C linkage of overloaded function '_aligned_offset_malloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 599
Error 29 error C2733: second C linkage of overloaded function '_aligned_malloc_dbg' not allowed c:\program files\microsoft visual studio 8\vc\include\stdlib.h 598
Error 28 error C2059: syntax error : 'string' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 598
Error 30 error C2059: syntax error : 'string' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 599
Error 32 error C2059: syntax error : 'string' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 600
Error 34 error C2059: syntax error : 'string' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 601
Error 36 error C2059: syntax error : 'string' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 602
Error 38 error C2059: syntax error : 'string' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 603
Error 16 error C2059: syntax error : 'constant' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 488
Error 18 error C2059: syntax error : 'constant' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 592
Error 20 error C2059: syntax error : 'constant' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 593
Error 22 error C2059: syntax error : 'constant' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 594
Error 24 error C2059: syntax error : 'constant' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 595
Error 26 error C2059: syntax error : 'constant' c:\program files\microsoft visual studio 8\vc\include\stdlib.h 596
Error 46 error C2039: 'realloc' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 8\vc\include\cstdlib 26
Error 44 error C2039: 'malloc' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 8\vc\include\cstdlib 24
Error 42 error C2039: 'free' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 8\vc\include\cstdlib 23
Error 40 error C2039: 'calloc' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 8\vc\include\cstdlib 22

problems with cstdlib + stdlib.h?
Manesh_myworld
"_CRTDBG_MAP_ALLOC"
from the preproccesor definitions.
How it got there, I do not know, it was not in the make file for the project. If anyone has had a similar problem and knows why it occured, I would like to know why.
rkalantri
The program compiles and runs in release mode, however these issues occur only when trying to compile in debug mode
LucLuc
You can actually diagnose the problem your self by using the /P compiler option which preprocess your code and produces a preprocessed version of your file. Compare the release with the debug and see what is the difference in definitions that leads to this error.
Thanks, Ayman Shoukry VC++ TeamJesper Arent DK
This is happening to me now. I don't even have those files included, and I am getting the error. It doesn't matter if it is Debug or Release for me, it just won't compile. So I tried the /P option, and it compiles, but it doesn't give me the file with the preproccessor code passed through it. Any advice
Charles
<edit>
Got it. I added #define _CSTDLIB_ before all my headers, and the error went away. I figured it wasn't reading the file correctly, that or out of order.
</edit>