引用:   http://www.cnblogs.com/oskycar/archive/2009/08/30/1556920.html

VS2013

在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'中均包含了改宏,所以错误会照旧的。偶刚开始就犯了这个错误,还以为是各位高手犯错误了呢。呵呵

编译cvaux错误的原因的更多相关文章

  1. 记录一次使用VS2015编译错误的原因查找(boost+gdal)

    编译错误说明 在一个解决方案中的项目A中使用到了boost,完全没有问题.在项目B中也使用了boost库,编译的时候就产生了一堆错误. 原因查找 两个项目通过对比,唯一的不同就是项目B使用了gdal库 ...

  2. qt 旧项目编译运行提示 “启动程序失败,路径或者权限错误?” 原因及解决方法

    qt 旧项目编译运行提示 "启动程序失败,路径或者权限错误?" 原因及解决方法 原因 Qt Creator在打开项目文件的同时会生成.pro.user文件,.pro.user文件叫 ...

  3. [转载]触发ASSERT(afxCurrentResourceHandle != NULL)错误的原因

    触发ASSERT(afxCurrentResourceHandle != NULL)错误的原因 Debug Assert error afxwin1.inl line:22 翻译参考 http://w ...

  4. C++常见gcc编译链接错误解决方法

    除非明确说明,本文内容仅针对x86/x86_64的Linux开发环境,有朋友说baidu不到,开个贴记录一下(加粗字体是关键词): 用“-Wl,-Bstatic”指定链接静态库,使用“-Wl,-Bdy ...

  5. Duplicate Symbol链接错误的原因总结和解决方法[转]

    from:http://www.cocoachina.com/bbs/read.php?tid=177492 duplicate symbol是一种常见的链接错误,不像编译错误那样可以直接定位到问题的 ...

  6. C++编译常见错误

    error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To di ...

  7. VS编译常见错误枚举01

    fatal error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0403. Valu ...

  8. 出现 java.lang.OutOfMemoryError: PermGen space 错误的原因及解决方法

    一.原因及解决方法[1] 1.原因:堆内存的永久保存去区内存分配不足(缺省默认为64M),导致内存溢出错误. 2.解决方法:重新分配内存大小,-Xms1024M -Xmx2048M -XX:PermS ...

  9. Tomcat项目启动常见错误以及原因,持续更新.........

    一 Context initialization failed 错误截图: 原因: jdk版本与项目不对应,可重新设置项目jdk和ide编译的jdk即可

随机推荐

  1. 内存溢出System.OutOfMemoryException

    .Net 内存溢出(System.OutOfMemoryException)的常见情况和处理方式总结 在什么情况下会出现OutOfMemonryException呢? 在我们试图新建一个对象时,而垃圾 ...

  2. Spring MVC(一)

    MVC这种设计模式,不光运用于Web领域,而且也能用于非Web领域,MVC特指一种表现层设计模式,不限于Java语言 spring mvc属于spring框架的后续产品,用在基于MVC的表现层开发,类 ...

  3. python获取

    def anc():pass print anc.__name__ def timeit(func): def run(*argv): print "this function name i ...

  4. [PCB设计] 3、用CAM350修改GERBER文件(删除某些部分)

    1.问题产生 由于在电子元件封装时阻焊开窗未处理好,生成的GERBER文件在生产钢网时容易出现错误.比如:测试点上不需要上锡,如果封装元件时采用焊盘修改而来,结果往往使paste层在该测试点上有覆盖, ...

  5. JS逻辑运算大于小于比较

    遇到这个问题,结果测试了好半天终于发现原因, 例子: var az = $('#a').css('zIndex'); // 1001 var bz = $('#b').css('zIndex'); / ...

  6. Visual Studio提示“无法启动IIS Express Web服务器”的解决方法

    有时,在使用Visual Studio运行ASP.NET项目时,会提示"无法启动IIS Express Web服务器",无法运行,如图: 这一般出现在重装系统之后,或者项目是从别的 ...

  7. SPFA算法与dijkstra算法求单源最短路径的比较

    SPFA是运用队列,把所有的点遍历到没有能更新的,点可以重复入队 如题http://www.cnblogs.com/Annetree/p/5682306.html dijkstra是每次找出离源点最近 ...

  8. TypeError: document.getELementById is not a function

    这个错误困扰了我好几个小时,在网上也百度了好久类似的问题但都没有结果,反反复复看了好多遍,才发现,原来是document.getELementById 里面的Element的字母 l 我写成了大写的L ...

  9. vs2015打开cshtml文件失败的解决方法

    最近不知道为什么,用vs2015打开cshtml识图文件的时候会报错.也不知道是什么原因,google之后得到解决方法如下: Close VS Delete the content of %Local ...

  10. LeetCode OJ 1. Two Sum

    Given an array of integers, return indices of the two numbers such that they add up to a specific ta ...