Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 772 Bytes

compiler-error-c2761.md

File metadata and controls

42 lines (33 loc) · 772 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2761
Compiler Error C2761
11/04/2016
C2761
C2761
38c79a05-b56d-485b-820f-95e8c0cb926f

Compiler Error C2761

'function' : member function redeclaration not allowed

You cannot redeclare a member function. You can define it, but not redeclare it.

Examples

The following sample generates C2761.

// C2761.cpp
class a {
   int t;
   void test();
};

void a::a;     // C2761
void a::test;  // C2761

Nonstatic members of a class or structure cannot be defined. The following sample generates C2761.

// C2761_b.cpp
// compile with: /c
struct C {
   int s;
   static int t;
};

int C::s;   // C2761
int C::t;   // OK