This documentation is archived and is not being maintained.

Compiler Error C2653

Error Message

'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;