可能性の重複をコンパイルしません:
static members and LNK error in C++
What does it mean to have an undefined reference to a static member?C++静的変数。
私はこのクラスを持っている:
class A_GItem
{
public:
void create_item();
private:
static int static_index;
}
create_item機能は、単にようである:
void create_item() { static_index++; }
コンパイルが(クリーン後、問題を解決しようとしている)私が持っている: エラーLNK2001:未解決の外部シンボル「プライベート:静的int型A_GItem :: static_index
を任意のアイデア?おかげ