牛人帮解决vc下编译出错C2057 C2466,谢谢
#define MC_PCC_FILL_STRUCT3 u8:0; u8:8; u8:8; u8:8; u8:0;
typedef struct __alg { char c; MC_PCC_FILL_STRUCT3 void * p; } __alg_t;
#define MC_PPC_DISTANCE_OF(S,F) (unsigned) (&(((S *) 0)->F))
#define ALIGNMENT (MC_PPC_DISTANCE_OF(__alg_t, p) - 1)
#define ALIGN(P) ( (u32) ((char *)(P) + ALIGNMENT) & ~ALIGNMENT)
u8 InterruptStack[ALIGN( INTERRUPT_STACK_SIZE )];
u8 stack_task0[ALIGN (STACK0_SIZE) ];
编译出错:
d:\tool\type.hiv(40) : error C2057: expected constant expression
d:\tool\type.hiv(40) : error C2466: cannot allocate an array of constant size 0
d:\tool\type.hiv(41) : error C2057: expected constant expression
d:\tool\type.hiv(41) : error C2466: cannot allocate an array of constant size 0
typedef struct __alg { char c; MC_PCC_FILL_STRUCT3 void * p; } __alg_t;
#define MC_PPC_DISTANCE_OF(S,F) (unsigned) (&(((S *) 0)->F))
#define ALIGNMENT (MC_PPC_DISTANCE_OF(__alg_t, p) - 1)
#define ALIGN(P) ( (u32) ((char *)(P) + ALIGNMENT) & ~ALIGNMENT)
u8 InterruptStack[ALIGN( INTERRUPT_STACK_SIZE )];
u8 stack_task0[ALIGN (STACK0_SIZE) ];
编译出错:
d:\tool\type.hiv(40) : error C2057: expected constant expression
d:\tool\type.hiv(40) : error C2466: cannot allocate an array of constant size 0
d:\tool\type.hiv(41) : error C2057: expected constant expression
d:\tool\type.hiv(41) : error C2466: cannot allocate an array of constant size 0
...全文
相关推荐
编译出错的VC MFC的DLL库
在编程过程中,遇到“编译出错的VC MFC的DLL库”问题,这通常意味着在使用Microsoft Visual C++(VC)开发MFC(Microsoft Foundation Classes)动态链接库
vc编译运行出错的详细解释
本文将深入解析VC编译运行出错的各种常见情况,并提供针对性的解决方案,帮助开发者有效调试代码。### 1.
VC6.0中“Open File”与“Add to Project”出错+解决办法
编译FileTool**- 使用VC6.0打开解压后的`filetool.dsw`文件。- 在解决方案配置中选择合适的编译模式(例如Win32 Release)。
vc C语言编译
vc C语言编译"这个标题暗示我们讨论的是使用Microsoft Visual C++(通常简称为VC++)作为C语言的编译环境。
VC-Debug-Release]出错的问题解决办法
VC-Debug-Release 版本差异及调试相关问题解决办法在调试 VC 程序时,经常出现 Release 版本或者 Debug 版本运行崩溃的问题,本文给出了多种解决方法,以帮助开发者解决这些问题


