次の方法で共有


コンパイラ エラー C2370

'identifier' : 再定義 ; 異なるストレージ クラスです。

識別子は、異なるストレージ クラスで既に宣言されています。

次の例では C2370 が生成されます。

// C2370.cpp
// compile with: /Za /c
extern int i;
static int i;   // C2370
int i;   // OK

次の例では C2370 が生成されます。

// C2370b.cpp
#define Thread __declspec( thread )
extern int tls_i;
int Thread tls_i;   // C2370 declaration and the definition differ
int tls_i;   // OK