Teilen über


Compilerfehler C2479

"Identifier" : "allocate( )" ist nur gültig für Datenelemente statischen Umfangs

Bemerkungen

Die __declspec( allocate()) Syntax kann nur für statische Daten verwendet werden.

Example

Im folgenden Beispiel wird C2479 generiert:

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