Original Post
class cTest
{
public:
int obj;
};
int main( void )
{
cTest test1;
test1.obj = 5;
return 0;
}
class cTest
{
public:
static int obj;
};
int main( void )
{
cTest test1;
test1.obj = 5;
return 0;
}
quote:Can someone please explain why?
Compiling... main.cpp H:\dokument\test\main.cpp(12) : warning C4101: 'test1' : unreferenced local variable Linking... main.obj : error LNK2001: unresolved external symbol "public: static int cTest::obj" (?obj@cTest@@2HA) Debug/main.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. main.exe - 2 error(s), 1 warning(s)
-Luctus Codito, Ergo Sum (Courtesy of ThinkGeek) [Mail][DreggSoft] [edited by - Luctus on February 26, 2003 10:53:24 AM]