Error when using static member variable in multiple cpp files with Windriver diab
<pre><code>//A.h file
class A
{
   private:
   static int i;

   public:
   static void testStatic()
   {
      //This function uses static member variable i.
       cout &lt;&lt; "This function uses static member variable i" &lt;&lt; endl;
   }
};

//B.h file
class B: public A
{
public:
   B()
   {
   }
   ~B()
   {
   }
};
</code></pre>

<p>B.h is being included in multiple .cpp files (say one.cpp and two.cpp).
Only in one of the .ccp files (one.cpp), the static member variable A::i is defined as below:</p>

<pre><code>int  A::i;
</code></pre>

<p>The above gets compiled and linked in GCC, but with Wind river Diab compiler, it throws the below linking error.</p>

<pre><code>dld: warning: Undefined symbol in file 'two.o':A::i
</code></pre>

<p>What could the problem be?</p>
