expected declaration specifiers or '...' before numeric constant malloc.c C/C++ Problem
代码是这样写的
__align(32) u8 mem1base[MEM1_MAX_SIZE]; //内部SRAM内存池
__align(32) u8 mem2base[MEM2_MAX_SIZE] __attribute__((at(0X68000000))); //外部SRAM内存池
//内存管理表
u16 mem1mapbase[MEM1_ALLOC_TABLE_SIZE]; //内部SRAM内存池MAP
u16 mem2mapbase[MEM2_ALLOC_TABLE_SIZE] __attribute__((at(0X68000000+MEM2_MAX_SIZE))); //外部SRAM内存池MAP
下面还有一句调用mem1base和mem2base的语句
//内存管理控制器
struct _m_mallco_dev mallco_dev=
{
my_mem_init, //内存初始化
my_mem_perused, //内存使用率
mem1base,mem2base, //内存池
mem1mapbase,mem2mapbase, //内存管理状态表
0,0, //内存管理未就绪
};
编译结果报错:
'mem1base' undeclared here (not in a function); did you mean 'mem1mapbase'?
'mem2base' undeclared here (not in a function); did you mean 'mem2mapbase'?
expected declaration specifiers or '...' before numeric constant
expected declaration specifiers or '...' before numeric constant
请问是什么原因导致了这样呢?