Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C2653
Collapse the table of content
Expand the table of content

Compiler Error C2653

'identifier' : is not a class or namespace name

Syntax requires a class, structure, union, or namespace name.

The following sample generates C2653:

// C2653.cpp
// compile with: /c
class yy {
   void func1(int i);

void xx::func1(int m) {}   // C2653
void yy::func1(int m) {}   // OK

C2653 is also possible if you try to define a compound namespace; compound namespaces are not allowed in C++:

// C2653b.cpp
namespace a::b {int i;}   // C2653

namespace a {
   namespace b {
      int i;

int main() {
   a::b::i = 2;
© 2015 Microsoft