This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
Compiler Warning (level 1) C4005
'identifier' : macro redefinition
The macro identifier is defined twice. The compiler uses the second macro definition.
Possible cause
- Defining a macro on the command line and in the code with a #define directive.
- Macros imported from include files.
Possible solutions
- Remove one of the definitions.
- Use an #undef directive before the second definition.
The following sample generates C4005:
#include <iostream.h>
#define TEST "test1"
#define TEST "test2" // C4005, delete or rename to resolve the warning
void main() {
cout << TEST << endl;
}