Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 803 Bytes

compiler-error-c2158.md

File metadata and controls

35 lines (27 loc) · 803 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2158
Compiler Error C2158
11/04/2016
C2158
C2158
39028899-e95c-4809-8e65-6111118641ee

Compiler Error C2158

'type' : #pragma make_public directive is currently supported for native non-template types only

The make_public pragma can only be applied to a native, non-template type.

Example

The following sample generates C2158.

// C2158.cpp
// compile with: /clr /c
ref class A {};
#pragma make_public(A)   // C2158

template< typename T >
class B {};
#pragma make_public(B)   // C2158
#pragma make_public(B<int>)   // C2158

void C () {}
#pragma make_public(C)   // C2158

class D {};
#pragma make_public(D)   // OK