次の方法で共有


コンパイラ エラー C2505

'symbol' : '__declspec(modifer)' は、グローバル オブジェクトの宣言または定義、および静的データ メンバーにのみ適用できます

注釈

グローバル スコープでのみ使用されるように設計された __declspec 修飾子が関数で使用されました。

詳細については、「 appdomain 」および「 process」を参照してください。

Example

次の例では 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
}