This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
Compiler Error C2597
illegal reference to non-static member 'identifier'
Possible causes
- 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.
Example
struct s1 { // in cpp file
static void func();
int i;
};
void s1::func()
{
i = 1; // error C2597 here
}