RSS
Follow Us
Contribute
 
 
 
 

Error C2011: (identifier): (type) type redefinition

 
We need YOUR SKILLS in this collaborative work, to build the largest solution center for error messages.

From $1

Table of contents
  1. 1. Cause
  2. 2. Solution

Cause

This error message appears in Visual C++ when an enum or union identifier has been used as type definition before. Ex;

struct someStruct {
	int a;
	int b;
};

int main() {
	enum someStruct;	//This line will generate C2011
}

Solution

Change the identifier to another value so that the type definition and identifier will not be mixed by the compiler.

struct someStruct {
	int a;
	int b;
};

int main() {
	enum e;
}
 
 
 
 
Comments