0

Have class B, A have some methods,

class B : public A
{
private:
    static constexpr int num_c[18] = {1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36} ;
public:
    B(int mise) : A(mise) {}
    virtual int g(int winning_number) const override { 
    for(int i(0); i < 18; ++i)
    { 
        if(wg_n == num_c[i]) 
            return this->mise();} return 0;
    }}
};

compiler says:

undefined reference to `B::num_c'

How can I fix this?

Barry
  • 286,269
  • 29
  • 621
  • 977
NonSense
  • 173
  • 1
  • 2
  • 13
  • You haven't defined `num_c` (and to be pedantic, it's being odr-used). See http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix – chris Apr 27 '15 at 21:43
  • @chris: That's not "pedantic". It's a crucial and key point. Why is being correct "pedantic" now everywhere I go? :( – Lightness Races in Orbit Apr 27 '15 at 22:33

0 Answers0