This documentation is archived and is not being maintained.

Compiler Error C3163

Error Message

'construct': attributes inconsistent with previous declaration

The attribute(s) applied to a definition conflict with the attribute(s) applied to a declaration.

One way to resolve C3163 is to not to have any attributes on the forward declaration; attributes on a forward declaration should be at most equal to or less than the attributes on the definition.

Example

The following sample generates C3163.

// C3163.cpp
// compile with: /clr /c
using namespace System;

[CLSCompliant(true)] void f();
[CLSCompliant(false)] void f() {}   // C3163
// try the following line instead
// [CLSCompliant(true)] void f() {}
Show: