编译以下代码时出现以下错误:
3>c:\hedge\hedge\hedge\AisTarget.h(22) : error C2059: syntax error : 'constant'
3>c:\hedge\hedge\hedge\AisTarget.h(22) : error C2238: unexpected token(s) preceding ';'
Run Code Online (Sandbox Code Playgroud)
#if !defined(AisTarget_h)
#define AisTarget_h
#include "GeneralAviationItems.h"
#include <string>
namespace HEDGE {
using namespace GeneralAviation;
class AisTarget : public WaypointLatLon {
public:
static const int NO_DATA = -1000; //here is the error
};
} // end namespace HEDGE
#endif
Run Code Online (Sandbox Code Playgroud)
即使这篇文章有它的年龄:当多个重新定义(即使大小写)共存时,通常也会发生错误。这包括解决方案的.vcprojx文件中潜在的预处理器定义!. 考虑类似
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>$(Configuration);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
Run Code Online (Sandbox Code Playgroud)
在上面提到的文件中。现在,有了“调试”和“发布”配置,您很可能会遇到一些问题和 C2059 错误的潜在来源。我经历过这种困境。
| 归档时间: |
|
| 查看次数: |
23568 次 |
| 最近记录: |