Hi,
I was just wondering if anyone could explain in simple terms what these errors are, and why they come about.
More specifically if you could explain why this code:
produces this error
whenever I try to call it from my main.cpp using Binary::InitMas k(); (Binary is the class name where this function is declared. I've also tried calling this function using a Binary object eg binObj.InitMask (); The error is the same.
I've only had a few weeks of C++ so pointers etc are a little confusing after learning Java, so the simpler the explanation the better!!
I was just wondering if anyone could explain in simple terms what these errors are, and why they come about.
More specifically if you could explain why this code:
Code:
static const int SIZE = 8*sizeof(unsigned);
static int* mask[SIZE];
public: static void InitMask()
{
int num = 1;
for (int i=0;i<SIZE;i++)
{
mask[i] = #
num=num*2;
}
}
Code:
main.obj : error LNK2001: unresolved external symbol "private: static int * * Binary::mask" (?mask@Binary@@0PAPAHA) fatal error LNK1120: 1 unresolved externals
I've only had a few weeks of C++ so pointers etc are a little confusing after learning Java, so the simpler the explanation the better!!
Comment