| title |
Compiler Error C2505 | Microsoft Docs |
| ms.custom |
|
| ms.date |
11/04/2016 |
| ms.reviewer |
|
| ms.suite |
|
| ms.technology |
|
| ms.tgt_pltfrm |
|
| ms.topic |
error-reference |
| f1_keywords |
|
| dev_langs |
|
| helpviewer_keywords |
|
| ms.assetid |
b19f5c53-399d-425e-90db-fe3ca9b40858 |
| caps.latest.revision |
10 |
| author |
corob-msft |
| ms.author |
corob |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
'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;
int main() {
__declspec(process) int i; // C2505
__declspec(appdomain) int j; // C2505
}