编译cvaux错误的原因
生活随笔
收集整理的這篇文章主要介紹了
编译cvaux错误的原因
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
平臺vc6.0; 在debug模式下編譯cvaux時會提示三個錯誤: error C2039: 'foreground_regions' : is not a member of 'CvFGDStatModel'
error C2039: 'foreground_regions' : is not a member of 'CvFGDStatModel'
error C2039: 'foreground_regions' : is not a member of 'CvGaussBGModel' 在網上搜到的解決方法都是這樣寫的: 在cvaux.h文件中, 搜索關鍵字foreground_regions,
CvMemStorage* storage; /*storage for 揻oreground_regions?/ \
CvSeq* foreground_regions /*foreground object contours*/
改為如下形式:
CvMemStorage* storage; /*storage for foreground_regions*/ \
CvSeq* foreground_regions /*foreground object contours*/ 具體原因解釋如下:首先foreground_regions 定義在這個宏里面: #define CV_BG_STAT_MODEL_FIELDS()?????????????????????????????????????????????????? \
??? int???????????? type; /*type of BG model*/????????????????????????????????????? \
??? CvReleaseBGStatModel release;?????????????????????????????????????????????????? \
??? CvUpdateBGStatModel update;???????????????????????????????????????????????????? \
??? IplImage*?????? background;?? /*8UC3 reference background image*/?????????????? \
??? IplImage*?????? foreground;?? /*8UC1 foreground image*/???????????????????????? \
??? IplImage**????? layers;?????? /*8UC3 reference background image, can be null */ \
??? int???????????? layer_count;? /* can be zero */???????????????????????????????? \
??? CvMemStorage*?? storage;????? /*storage for 揻oreground_regions?*/????????????? \
??? CvSeq*????????? foreground_regions /*foreground object contours*/ “\”在這里代表續行的意思。并且注意前面定義的變量后面都有“;”號,而foreground_regions沒有,因為它是這個定義的最后一項,因為宏定義末尾是不加‘;’號的。 另外要注意的是,千萬不要在修改最后兩行時寫成這個樣子:??? CvMemStorage*?? storage;????? /*storage for 揻oreground_regions?*/????????????? \
??? CvSeq*????????? foreground_regions /*foreground object contours*/ 即不能放入空行,因為這樣一來foreground_regions就不屬于宏定義中的一份了。而'CvFGDStatModel'和'CvGaussBGModel'中均包含了改宏,所以錯誤會照舊的。偶剛開始就犯了這個錯誤,還以為是各位高手犯錯誤了呢。呵呵
error C2039: 'foreground_regions' : is not a member of 'CvFGDStatModel'
error C2039: 'foreground_regions' : is not a member of 'CvGaussBGModel' 在網上搜到的解決方法都是這樣寫的: 在cvaux.h文件中, 搜索關鍵字foreground_regions,
CvMemStorage* storage; /*storage for 揻oreground_regions?/ \
CvSeq* foreground_regions /*foreground object contours*/
改為如下形式:
CvMemStorage* storage; /*storage for foreground_regions*/ \
CvSeq* foreground_regions /*foreground object contours*/ 具體原因解釋如下:首先foreground_regions 定義在這個宏里面: #define CV_BG_STAT_MODEL_FIELDS()?????????????????????????????????????????????????? \
??? int???????????? type; /*type of BG model*/????????????????????????????????????? \
??? CvReleaseBGStatModel release;?????????????????????????????????????????????????? \
??? CvUpdateBGStatModel update;???????????????????????????????????????????????????? \
??? IplImage*?????? background;?? /*8UC3 reference background image*/?????????????? \
??? IplImage*?????? foreground;?? /*8UC1 foreground image*/???????????????????????? \
??? IplImage**????? layers;?????? /*8UC3 reference background image, can be null */ \
??? int???????????? layer_count;? /* can be zero */???????????????????????????????? \
??? CvMemStorage*?? storage;????? /*storage for 揻oreground_regions?*/????????????? \
??? CvSeq*????????? foreground_regions /*foreground object contours*/ “\”在這里代表續行的意思。并且注意前面定義的變量后面都有“;”號,而foreground_regions沒有,因為它是這個定義的最后一項,因為宏定義末尾是不加‘;’號的。 另外要注意的是,千萬不要在修改最后兩行時寫成這個樣子:??? CvMemStorage*?? storage;????? /*storage for 揻oreground_regions?*/????????????? \
??? CvSeq*????????? foreground_regions /*foreground object contours*/ 即不能放入空行,因為這樣一來foreground_regions就不屬于宏定義中的一份了。而'CvFGDStatModel'和'CvGaussBGModel'中均包含了改宏,所以錯誤會照舊的。偶剛開始就犯了這個錯誤,還以為是各位高手犯錯誤了呢。呵呵
轉載于:https://www.cnblogs.com/oskycar/archive/2009/08/30/1556920.html
總結
以上是生活随笔為你收集整理的编译cvaux错误的原因的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 函数调试
- 下一篇: 【RPA】PDF生成器FPDF(Pyth