我正在使用VC-Express 2013.我已经集成了一个使用boost库的不同项目的头文件,并且在releasemode中编译时一切都很好。当我尝试在调试模式下编译时,我遇到了以下几个错误:
Error 2 error C2059: syntax error : ']'
has_new_operator.hpp 67 1
Error 3 error C2976: 'boost::detail::test' : too few template arguments
has_new_operator.hpp 68 1
Warning 7 warning C4346: 'U::new' : dependent name is not a type
has_new_operator.hpp 89 1
包含的头文件的开头如下所示:
#ifndef AREACLASS_H_
#define AREACLASS_H_
#include "stdafx.h"
#include "global.h"
#include <iostream>
#include <deque>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/io/wkt/wkt.hpp>
#include <boost/foreach.hpp>
#include "triangulation.h"
#include "SplineContainerClass.h"
class AreaClass
{
private:
rectangle<double> boundingbox;
SplineContainerClass *SplineContainer;
polygon boundary_polygon;
Vector2dVector polygonTriangles;
public:
AreaClass();
AreaClass(SplineContainerClass *_SplineContainer);
AreaClass(GenericSplineClass *_Spline);
~AreaClass();
void appendSpline(GenericSplineClass *_Spline);
void appendSpline(SplineContainerClass *_SplineContainer);
void appendSplineReverse(SplineContainerClass *_SplineContainer);
bool DeleteSplineContainer();
bool GeneratePolygon();
void DrawPrototypView(bool Highlight, bool DrawTangents);
//Accessor Functions
double minx() { return(boundingbox.left); }
double maxx() { return(boundingbox.right); }
double miny() { return(boundingbox.bottom); }
double maxy() { return(boundingbox.top); }
};
#endif /* AREACLASS_H_ */
即使我将AreaClass设为空类并删除triangulation.h和SplineContainerClass.h,也会出现相同的错误。造成这种情况的原因是什么?如何解决?
答案 0 :(得分:2)
stdafx.h是否包含任何#define new DEBUG_NEW
内容?如果是这样,那么只需注释掉该行,构建就可能通过。