Serious error: C2432E: non-constant initialiser

来源:互联网 发布:java中aop是什么意思 编辑:程序博客网 时间:2024/06/03 19:36

全局变量

extern int sxmobi_ph_city_size;

int size = sxmobi_ph_city_size*sizeof(unsigned int);

MTK编译会报Serious error: C2432E: non-constant initialiser的错误


改成如下就不会

extern int sxmobi_ph_city_size;

int size;

void f()

{

        size = sxmobi_ph_city_size*sizeof(unsigned int);

}