//header.hh
#include <iostream>
using std::ios;
using std::endl;
class A : public B
{
public:
staticbool abool;
static std::ostream xyz;
}
//class.cc
#include <iostream>
#include "header.hh"
using std::ios;
using std::endl;
// i have to define those static variables first to use it
bool A::abool;
std::ostream A::xyz;
Here, while compilng i get error saying that
undefined reference to A::xyz
but there is no error with A::abool ??
Can anyone explain why this error is there and how to remove it ??
Thanks.