Edit

Share via


Compiler Error C2850

'construct' : only allowed at file scope; may not be in a nested construct

Remarks

Constructs, such as some pragmas, can only appear at global scope.

Example

The following example generates C2850:

// C2850.cpp
// compile with: /c /Yc
// try the following line instead
// #pragma hdrstop
namespace X {
   #pragma hdrstop   // C2850
};