我用atl做了一个dll文件,其中.cpp文件中有如下定义:
typedef struct _NODE
{
BOOL bIsLeaf; // TRUE if node has no children
UINT nPixelCount; // Number of pixels represented by this leaf
UINT nRedSum; // Sum of red components
UINT nGreenSum; // Sum of green components
UINT nBlueSum; // Sum of blue components
struct _NODE* pChild[8]; // Pointers to child nodes
struct _NODE* pNext; // Pointer to next reducible node
}NODE;
我编译时报错:
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(27) : error C2040: 'NODE' : 'struct _NODE' differs in levels of indirection from 'int [][2]'
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(313) : error C2227: left of '->bIsLeaf' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(314) : error C2227: left of '->nPixelCount' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(315) : error C2227: left of '->nRedSum' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(316) : error C2227: left of '->nGreenSum' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(317) : error C2227: left of '->nBlueSum' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(326) : error C2227: left of '->pChild' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(338) : error C2070: illegal sizeof operand
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(341) : error C2227: left of '->bIsLeaf' must point to class/struct/union
这是什么原因,怎么解决。
typedef struct _NODE
{
BOOL bIsLeaf; // TRUE if node has no children
UINT nPixelCount; // Number of pixels represented by this leaf
UINT nRedSum; // Sum of red components
UINT nGreenSum; // Sum of green components
UINT nBlueSum; // Sum of blue components
struct _NODE* pChild[8]; // Pointers to child nodes
struct _NODE* pNext; // Pointer to next reducible node
}NODE;
我编译时报错:
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(27) : error C2040: 'NODE' : 'struct _NODE' differs in levels of indirection from 'int [][2]'
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(313) : error C2227: left of '->bIsLeaf' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(314) : error C2227: left of '->nPixelCount' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(315) : error C2227: left of '->nRedSum' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(316) : error C2227: left of '->nGreenSum' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(317) : error C2227: left of '->nBlueSum' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(326) : error C2227: left of '->pChild' must point to class/struct/union
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(338) : error C2070: illegal sizeof operand
C:\Suntendy\SuntendyTwaindll\DibEngine\CqOctree.cpp(341) : error C2227: left of '->bIsLeaf' must point to class/struct/union
这是什么原因,怎么解决。
解决方案 »
- 关于读串口的问题
- 非模式对话框如何居中显示?
- 求助opencv运行错误 bad flag(parameter or structure field)
- 急用,高分征求(PCX格式文件转换成GIF和BMP文件格式的C语言源程序)
- 如何用VC实现日志!高分送出
- 有没有那位大侠用过SAPI SDK的编程!能不能给点范例或提示
- 大家帮忙翻译一下这段文字,挺简单的文字我就是吃不透他的意思
- 属性包在Load的时候,IPropertyBag::Read()的调用次数比我实际需要的多
- 求VC++图像拼接代码? 不要用OpenCV实现。资料链接也可。
- ISAPI
- 做了个简单的OCX控件供C#调用,但产生错误
- 在ie中调用activex(ocx),提示应用程序发生异常,未知的软件异常(0xe06d7363),位置为0x77e6a4e1
是不是这个有问题?定义成struct _node * pChild就可以指向字节点了。