Hello!

There is such a thing:

const int sm=10; class X{ ... public: struct SMOKE{ int sV; static int index_sm; }; static SMOKE SM[sm]; }; int X::SMOKE index_sm=0;// на это не ругается rocket_parent::SMOKE rocket_parent::SM;// ругается на это/ Всяк пробовал... 

Here is what he writes:

 error LNK2001: unresolved external symbol "public: static struct rocket_parent::SMOKE * X::SM" (?SM@X@@2PAUSMOKE@1@A) 1>C:\...\ : fatal error LNK1120: 5 unresolved externals 

    1 answer 1

    http://ideone.com/LHkqpO

    • Would you add an important part of the code to the answer, eh? To make it clear how to do without looking at ideone. - VladD
    • And you can X :: SM [0] .sV = 2; is it set not in function? - Alerr
    • I tried to do this: X :: SM [sm] = {}; Everything compiles, even works for a while. and then an error like acesc video crashes ... what kind of nonsense. - Alerr
    • @Alerr: Sure that access violation is a completely different problem. - VladD
    • There are suggestions why it began to appear exactly when I refer to the static variable SM ?, and try / catch ee is not taken ... If SMOKE is created as a global structure, then everything is fine. - Alerr