The thermodynamic theory of nonhydrostatically stressed solids