|
-
March 13th, 2006, 06:36 AM
#1
Error & Warning
Code:
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
There is 1 error & 1 warning being displayed pointing to the line in bold above.The code is auto generated.
warning C4042: 'THIS_FILE' : has bad storage class
error C2143: syntax error : missing ')' before ';'
Kindly Help.
Regards,
Ankush Mehta
"The Child is the father of the Man."
William Wordsworth
-
March 14th, 2006, 04:31 PM
#2
Re: Error & Warning
My guess is that there is something wrong prior to this code. Maybe you included a erroneous header file?
This piece of code will generate the same warning/error:
Code:
void test( // the error is actually here
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__; // but the compiler reports this line
#endif
- petter
-
March 14th, 2006, 10:11 PM
#3
Re: Error & Warning
Make sure you have your #include headers before this code.
Don't put #include's after this code.
-
March 15th, 2006, 01:01 AM
#4
Re: Error & Warning
use this code after ur include header files.
Code:
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
If I Helped You, "Rate This Post"
Thanks
Guna
-
March 16th, 2006, 12:23 AM
#5
Re: Error & Warning
Thanks all, the error was in a header file.
Regards,
Ankush Mehta
"The Child is the father of the Man."
William Wordsworth
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|