冰川人看世界 2015-07-28 00:41 采纳率: 100%
浏览 2258
已采纳

ignored on left of 'const double' when...

MFC项目中,我在stdafx.h文件中添加#include "ximage.h"(Cximage的一个头文件),DrawObj.cpp文件引用
stdafx.h,编译时报如下错误:
1>DrawObj.cpp(24): warning C4091: '' : ignored on left of 'const double' when no variable is declared
1>DrawObj.cpp(24): error C2143: syntax error : missing ';' before 'constant'
1>DrawObj.cpp(24): error C2059: syntax error : 'constant'

定位到DrawObj.cpp的代码:
/* 常用的常量定义 */
21 const double INF = 1E200 ;
22 const double EP = 1E-10 ;
23 const int MAXV = 300 ;
24 const double PI = 3.14159265 ;
貌似也没发现问题。我把stdafx.h中的#include "ximage.h"这句注释掉,编译通过了。

请问各位大神,这是什么原因,怎么解决。

  • 写回答

2条回答 默认 最新

  • Arnold9009 2015-07-28 01:51
    关注

    把24行注释掉看看还有没有编译错误
    排除语句问题的话,那就是字符标点不符合要求的问题了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?