Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 782 Bytes

compiler-warning-level-1-c4272.md

File metadata and controls

22 lines (18 loc) · 782 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 1) C4272
Compiler Warning (level 1) C4272
11/04/2016
C4272
C4272
0d6c1de4-2eef-42c4-b861-c221f8b495ef

Compiler Warning (level 1) C4272

'function' : is marked __declspec(dllimport); must specify native calling convention when importing a function.

It is an error to export a function marked with the __clrcall calling convention, and the compiler issues this warning if you attempt to import a function marked __clrcall.

The following sample generates C4272:

// C4272.cpp
// compile with: /c /W1 /clr
__declspec(dllimport) void __clrcall Test();   // C4272
__declspec(dllimport) void Test2();   // OK