Member Variable in Header Undefined : <p>I'm trying to learn how to split my code up into header and source files, but don't understand why my member variable <code>attackPower</code> is considered undefined.</p>

<p>Enemy.h</p>

<pre><code>#pragma once

class Enemy{
protected:
    int attackPower;
public:
    Enemy();
    void setAttackPower(int a);
    virtual void attack() = 0;
};
</code></pre>

<p>Enemy.cpp</p>

<pre><code>#include &lt;iostream&gt;
#include "Enemy.h"

class Enemy {
public:
    Enemy::Enemy(){
        attackPower = 0;
    }
    void Enemy::setAttackPower(int a){
        attackPower = a;
    }
};
</code></pre>

<p>In Enemy.cpp, Visual Studio tells me </p>

<blockquote>
  <p>identifier "attackPower" is undefined</p>
</blockquote>
