The line static const double wg[11] = /* weights of the 20-point gauss rule */
should be static const double wg[*10*] = /* weights of the 20-point gauss rule */
The line static const double wg[11] = /* weights of the 20-point gauss rule */
should be static const double wg[*10*] = /* weights of the 20-point gauss rule */