C++ linker errors with static members
<pre><code>class fairy 
    {
    protected:
        bool x;
        int points;
    public:
        fairy();
        void intro(string, int);
        void call_decision(int, int);
    };

    fairy::fairy()
    {
        x = true;
        points = 0;
    }

    void fairy::intro(string NAME, int case_type)
    {
        int decision = 0;
        cout &lt;&lt; "Hello, my name is" &lt;&lt; NAME &lt;&lt; "." &lt;&lt; endl &lt;&lt; "What would you like to do" &lt;&lt; endl;
        while(x)
        {
        cout &lt;&lt; endl;
        cout &lt;&lt; "(1) Ask for a wish." &lt;&lt; endl;
        cout &lt;&lt; "(2) Offer to help the fairy." &lt;&lt; endl;
        cout &lt;&lt; "(3) Say goodbye to the fairy." &lt;&lt; endl;
        cin &gt;&gt; decision;
        call_decision(decision, case_type);
        }
    }

    class good : fairy
    {
    protected:
        int wish_num;
        bool HELP;
    public:a
        good();
        static string name;
        void wish();
        void help();
    };

    good::good()
    {
        name = "Sandy";
        wish_num = 0;   
        HELP = true;
    }

    void good::wish()
    {
        if (wish_num != 5)
        {
        cout &lt;&lt; "Your wish has been granted" &lt;&lt; endl;
        points += 10;
        wish_num++;
        }
        else
        {
            cout &lt;&lt; "Sorry, I can not grant you another wish" &lt;&lt; endl;
        }
    }

    void good::help()
    {
        if (HELP)
        {
            cout &lt;&lt; "THANK YOU" &lt;&lt; endl;
            points += 50;
            HELP = false;
        }
        else
        {
            cout &lt;&lt; "Thank you but I don't need anymore help." &lt;&lt; endl;
        }
    }

    class evil : fairy
    {
    protected:

    public:
        evil();
        static string name;
        void wish();
        void help();
    };

    evil::evil()
    {
        name = "Seth";
    }

    void evil::wish()
    {
        cout &lt;&lt; "NO!!!! MUHHHHHAAAA!!!" &lt;&lt; endl;
        points -= 10;
    }

    void evil::help()
    {
            cout &lt;&lt; "Thanks... NOT, I don't even want your help!!" &lt;&lt; endl;
            points -= 50;
    }

    class equivocal : fairy
    {
    protected:
        int wish_num;
    public:
        equivocal();
        static string name;
        void wish();
        void help();
    };

    equivocal::equivocal()
    {
        name = "Joe";
        wish_num = 0;
    }

    void equivocal::wish()
    {
        int random = (rand() % 2);
        if (random &amp;&amp; wish_num != 3)
        {
        cout &lt;&lt; "Your wish has been granted" &lt;&lt; endl;
        points += 10;
        wish_num++;
        }
        else
        {
            cout &lt;&lt; "Sorry, I can not grant you another wish" &lt;&lt; endl;
            points -= 10;
        }
    }

    void equivocal::help()
    {
        cout &lt;&lt; "I'll think about it" &lt;&lt; endl;
    }

    void fairy::call_decision(int decision, int case_type)
    {
    good one;
    evil two;
    equivocal three;

        {
        switch(decision)
        {
        case'1':
            {
                switch (case_type)
                    {
                        case '0':
                            one.wish();
                        case '1':
                            two.wish();
                        case '2': 
                            three.wish();
                    }
            }
        case '2':
            {
                switch (case_type)
                    {
                        case '0':
                            one.help();
                        case '1':
                            two.help();
                        case '2': 
                            three.help();
                    }
            }
        case '3':
            {
                x = false;
            }
        }
        }
    }

int main()
{
    fairy game;
    good one;
    evil two;
    equivocal three;
    string NAME;
    int case_type = 0;
    int num = rand();
    for (int i = 0; i &lt; 3; i++)
    {
    switch (num % 3)
        {
            case '0':
                NAME = one.name;
                case_type = 0;
            case '1':
                NAME = two.name;
                case_type = 1;
            case '2': 
                NAME = three.name;
                case_type = 2;
            default:
                case_type = -1;
        }

    game.intro(NAME, case_type);
    num++;
    }


}
</code></pre>

<p>Is it okay to define <code>fairy::call_decision</code> after all of the derived classes? (This allowed me to make references in the the base class of the derived classes.)</p>

<p>If so, why am I getting lnk 2001 errors when i try and compile?</p>

<p>If not, how can I get it to compile with the <code>void fairy::call_decision</code> defined right after the <code>void fairy::intro</code> definition?</p>
