We recommend using Visual Studio 2017

Compiler Error C2537


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 C2537.

specifier' : illegal linkage specification

Possible causes:

  1. The linkage specifier is not supported. Only the "C" linkage specifier is supported.

  2. "C" linkage is specified for more than one function in a set of overloaded functions. This is not allowed.

The following sample generates C2537:

// C2537.cpp  
// compile with: /c  
extern "c" void func();   // C2537  
extern "C" void func2();   // OK