Rediger

Del via


Compiler Error C2733

you cannot overload a function with 'C' linkage

More than one overloaded function is declared with extern "C" linkage. When using "C" linkage, only one form of a specified function can be external. Since overloaded functions have the same undecorated name, they can't be used with C programs.

This error may occur after an upgrade because of conformance changes in Visual Studio 2019. Starting in Visual Studio 2019 version 16.3, the /Zc:externC- compiler option relaxes this check. The option must come after any /permissive- option on the command line.

Example

The following sample generates C2733:

// C2733.cpp
extern "C" {
   void F1(int);
}

extern "C" {
   void F1();   // C2733
   // try the following line instead
   // void F2();
}

See also

Compiler Error C2116
extern (C++)
/Zc:externC (Use Standard C++ extern "C" rules)