I have a static class data member declared as:
static const float MINIMUM_ZOOM_FACTOR = 4.0;
I'm using this constant in a class member function like this:
zoomFactor_ = max(zoomFactor_, MINIMUM_ZOOM_FACTOR);
At this point, the compiler complains that MINIMUM_ZOOM_FACTOR is an undefined reference. However if I use it directly like this:
if(fabs(zoomFactor_ - MINIMUM_ZOOM_FACTOR) < EPSILON) ...
it works a-ok. What am I doing wrong?
MAXIMUM_ZOOM_FACTOR
and your first isn't. Thestatic
prevents it from being used outside its source file. – Job Jul 8 '10 at 9:27