Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 710 Bytes

fatal-error-c1191.md

File metadata and controls

32 lines (26 loc) · 710 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Fatal Error C1191
Fatal Error C1191
11/04/2016
C1191
C1191
2888c6c4-b4e6-449e-8ee0-7917f31086df

Fatal Error C1191

'dll' can only be imported at global scope

The instruction to import mscorlib.dll into a program that uses /clr programming cannot appear in a namespace or function, but must appear at global scope.

The following sample generates C1191:

// C1191.cpp
// compile with: /clr
namespace sample {
   #using <mscorlib.dll>   // C1191 not at global scope
}

Possible resolution:

// C1191b.cpp
// compile with: /clr /c
#using <mscorlib.dll>
namespace sample {}