Compiler Error C2597 (Windows CE 5.0)

Send Feedback

illegal reference to data member 'identifier' in a static member function

The following list shows possible causes for this error.s

  • A nonstatic member is specified in a static member function. To access the nonstatic member, you must create an instance of the class and use a member-access operator (. or ->).
  • The specified identifier is not a member of a class, structure, or union.
  • A member access operator refers to a nonmember function.

The following example shows ways this error might occur.

struct s1 {  // in cpp file
static voidfunc();
inti;
};

void s1::func()
{
i = 1;// error C2597 here
}

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.