Compiler Error C2731

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C2731.

identifier' : function cannot be overloaded

The functions main, WinMain, DllMain, and LibMain cannot be overloaded.

The following sample generates C2731:

// C2731.cpp  
extern "C" void WinMain(int, char *, char *);  
void WinMain(int, short, char *, char*);   // C2731  

Show: