Skip to content

Latest commit

 

History

History
58 lines (52 loc) · 1.2 KB

compiler-error-c2505.md

File metadata and controls

58 lines (52 loc) · 1.2 KB
title Compiler Error C2505 | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-tools
ms.tgt_pltfrm
ms.topic error-reference
f1_keywords
C2505
dev_langs
C++
helpviewer_keywords
C2505
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

Compiler Error C2505

'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  
}