Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

static member functions/data within libraries

0 views
Skip to first unread message

Morfeas

unread,
Mar 16, 2002, 12:06:18 PM3/16/02
to
Is there anything special about having static member functions and data in
a class that is defined within a library (DLL or .so or .a)?

I have the following :

class Test
{
public:
static void Temp();
void MyFunc();

private:
static int i;
};

void Test::MyFunc()
{
Test::Temp();
}

void Test::Temp()
{
i = 2;
}


When I compile this as a stand alone executable, it works fine.

When I compile as a library, the compiler says :

undefined reference to `Test::i'

Any ideas?

Thanks,

Morfeas

--
www.freecfm.com/m/morfeas

0 new messages