Kompilatorfel C2479

"identifierare" : "allokera( )" är endast giltig för dataobjekt av statisk omfattning

Anmärkningar

Syntaxen __declspec( allocate()) kan endast användas för statiska data.

Example

I följande exempel genereras C2479:

// C2479.cpp
// compile with: /c
#pragma section("mycode", read)
static __declspec(allocate("mycode")) void DoNothing() {}   // C2479
__declspec(allocate("mycode"))  int i = 0;   // OK