description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Compiler Error C2505 | Compiler Error C2505 | 11/04/2016 |
|
| b19f5c53-399d-425e-90db-fe3ca9b40858 |
'symbol' : '__declspec(modifer)' can only be applied to declarations or definitions of global objects or static data members
A __declspec
modifier that is designed to only be used at global scope was used in a function.
For more information, see appdomain and process.
The following sample generates C2505:
// C2505.cpp// compile with: /clr// OK__declspec(process) int ii; __declspec(appdomain) int jj; intmain() { __declspec(process) int i; // C2505__declspec(appdomain) int j; // C2505 }