more warnings

A

asdf

hi, all, how to deal with such warnings?

' ' declared 'static' but never defined

in my opinion, since the variable is not defined, can I directly delete
the variable to quiet the warning?

Thanks all.
 
M

Marcus Kwok

asdf said:
hi, all, how to deal with such warnings?

' ' declared 'static' but never defined

in my opinion, since the variable is not defined, can I directly delete
the variable to quiet the warning?

If you never use the variable anywhere, then you can delete it.
However, more likely, it has been declared but not defined, but it is
being used, in which case you must define it somewhere (usually in a
..cpp file).

For example:

class C {
public:
// declaration
static int Num;
};

// definition
int C::Num = 0;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top