Compiler Error C2267
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error C2267

'function' : static functions with block scope are illegal

A local function is declared static. Static functions must have global scope.

The following sample generates C2267:

// C2267.cpp
static int func2();   // OK
int main() {
    static int func1();   // C2267
© 2015 Microsoft