description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Compiler Warning (level 1) C4005 |
Compiler Warning (level 1) C4005 |
11/04/2016 |
|
|
7f2dc79a-9fcb-4d5b-be61-120d9cb487ad |
'identifier' : macro redefinition
The macro identifier is defined twice. The compiler uses the second macro definition.
-
Defining a macro on the command line and in the code with a
#define
directive. -
Macros imported from include files.
-
Remove one of the definitions.
-
Use an #undef directive before the second definition.
The following sample generates C4005:
// C4005.cpp
// compile with: /W1 /EHsc
#include <iostream>
using namespace std;
#define TEST "test1"
#define TEST "test2" // C4005 delete or rename to resolve the warning
int main() {
cout << TEST << endl;
}