Put a definition for the static member, outside of class declaration to solve linkage errors:
class A
{
static const int b = 10;
...
};
const int A::b;
~~~~~~~~~~~~~~~
In addition, any modification of a constant value (by weird castings) will invoke undefined behavior.
Undefined behavior is a unknown behavior, sometimes causes to crash the application, sometimes not.