| 请教各位大虾:我是新手,在调试中出现以下错误,但是不知如何解决。所对应的程序是在教程上拷贝过来的!我用的是VC6.0和ObjectArx2002。 代码如下: AcDbObjectId CCreateEnt::CreatePolygon(AcGePoint2d ptCenter, int number, double radius, double rotation, double width){
 AcGePoint2dArray points;
 double angle=*CCalculation::PI()/(double)number;
 for (int i = 0; i < number; i++)
 {
 AcGePoint2d pt;
 pt.x = ptCenter.x + radius * cos(i * angle);
 pt.y = ptCenter.y + radius * sin(i * angle);
 points.append(pt);
 }
 AcDbObjectId polyId = CCreateEnt::CreatePolyline(points, width);
 
 // 将其闭合
 AcDbEntity *pEnt;
 acdbOpenAcDbEntity(pEnt, polyId, AcDb::kForWrite);
 AcDbPolyline *pPoly=AcDbPolyline::cast(pEnt);
 if (pPoly!= NULL)
 {
 pPoly->setClosed(Adesk::kTrue);
 }
 pEnt->close();
 CModifyEnt::Rotate(polyId, ptCenter, rotation);
 return polyId;
 } 错误如下: D:\TEST\CreateEnts\CreateEnt.cpp(153) : error C2653: 'CCalculation' : is not a class or namespace nameD:\TEST\CreateEnts\CreateEnt.cpp(153) : error C2065: 'PI' : undeclared identifier
 D:\TEST\CreateEnts\CreateEnt.cpp(153) : error C2100: illegal indirection
 D:\TEST\CreateEnts\CreateEnt.cpp(166) : error C2065: 'AcDbPolyline' : undeclared identifier
 D:\TEST\CreateEnts\CreateEnt.cpp(166) : error C2065: 'pPoly' : undeclared identifier
 D:\TEST\CreateEnts\CreateEnt.cpp(166) : error C2653: 'AcDbPolyline' : is not a class or namespace name
 D:\TEST\CreateEnts\CreateEnt.cpp(166) : error C2065: 'cast' : undeclared identifier
 D:\TEST\CreateEnts\CreateEnt.cpp(166) : error C2106: '=' : left operand must be l-value
 D:\TEST\CreateEnts\CreateEnt.cpp(169) : error C2227: left of '->setClosed' must point to class/struct/union
 D:\TEST\CreateEnts\CreateEnt.cpp(172) : error C2653: 'CModifyEnt' : is not a class or namespace name
 D:\TEST\CreateEnts\CreateEnt.cpp(172) : error C2065: 'Rotate' : undeclared identifier
 执行 cl.exe 时出错.
 |