fixed compilation of calc_val.cpp