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 C2084

function 'function' already has a body

The function has already been defined.

In previous versions of Visual C++,

  • The compiler would accept multiple template specializations that resolved to the same actual type, although the additional definitions would never be available. The compiler will now detect these multiple definitions

  • __int32 and int were treated as separate types. The compiler now treats __int32 as a synonym for int. This means that the compiler will detect multiple definitions if a function is overloaded on both __int32 and int and give an error.

The following sample generates C2084:

// C2084.cpp
void Func(int);
void Func(int) {}   // define function
void Func(int) {}   // C2084 second definition

Possible resolution:

// C2084b.cpp
// compile with: /c
void Func(int);
void Func(int) {}

Community Additions

ADD
Show:
© 2015 Microsoft