解决办法:在程序中加入下面这段代码即可 #define cvQueryHistValue_1D( hist, idx0 ) \ ((float)cvGetReal1D( (hist)->bins, (idx0)))