Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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() {}

Community Additions

ADD
Show:
© 2015 Microsoft