stereophonic
asked on
error C2059 syntax errors, compiles in relase mode but not in debug mode
Hi,
I am getting a bunch of these errors in my python extension module code pointing to header files. Please note that I am getting
these errors only in debug mode. I don't get any errors in release mode. I am using visual studio .net 2003 to build my application
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdlib(1 7): error C2059: syntax error : ':'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdlib(1 9): error C2143: syntax error : missing '{' before ':'
How to get rid of these errors?
Thanks
I am getting a bunch of these errors in my python extension module code pointing to header files. Please note that I am getting
these errors only in debug mode. I don't get any errors in release mode. I am using visual studio .net 2003 to build my application
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdlib(1
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdlib(1
How to get rid of these errors?
Thanks
stereophonic,
> c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdlib
If you're cstdlib matches mine, then more then likely you're getting these errors because you're mixing standard headers with non-standard headers, or because you're missing a required STD header.
David Maisonave (Axter)
> c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdlib
If you're cstdlib matches mine, then more then likely you're getting these errors because you're mixing standard headers with non-standard headers, or because you're missing a required STD header.
David Maisonave (Axter)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Probably, you are including cstdlib (or another header that includes it) inside something like this:
#ifdef _DEBUG
// ....
#endif
This is the reason you get the error only in debug mode.
Also: Are you including <cstdio> from a .C file? In this case, you must include <stdio.h> and NOT <cstdio>. OR: rename your file to .cpp.
#ifdef _DEBUG
// ....
#endif
This is the reason you get the error only in debug mode.
Also: Are you including <cstdio> from a .C file? In this case, you must include <stdio.h> and NOT <cstdio>. OR: rename your file to .cpp.
ASKER
Thank you all for the great help
Errors in my code I guess was due to mixing up the standard headers with nonstandard headers.
I used all the suggestions made and finally got it compiled.
Thanks again
Errors in my code I guess was due to mixing up the standard headers with nonstandard headers.
I used all the suggestions made and finally got it compiled.
Thanks again
> How to get rid of these errors?
Please post the code you're getting these errors with.
David Maisonave (Axter)
Cheers!