新建了一个ARX工程,加入了两个文件,想定义一个类,代码如下: //zzz.h #include "dbmain.h" class CbzqCLASS : public AcDbEntity { public: ACRX_DECLARE_MEMBERS(CbzqCLASS); CbzqCLASS(void); virtual ~CbzqCLASS(void); virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const; virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* pFiler); virtual Adesk::Boolean worldDraw(AcGiWorldDraw* mode); virtual Acad::ErrorStatus CbzqCLASS::explode(AcDbVoidPtrArray& entitySet) const; virtual Acad::ErrorStatus CbzqCLASS::getGripPoints (AcGePoint3dArray & gripPoints,AcDbIntArray& osnapModes,AcDbIntArray& geomIds) const; virtual Acad::ErrorStatus CbzqCLASS::moveGripPointsAt(const AcDbIntArray& indices,const AcGeVector3d& offset); virtual Acad::ErrorStatus CbzqCLASS::transformBy(const AcGeMatrix3d& xform); //设置插入基点 Acad::ErrorStatus setBasePt(const AcGePoint3d pt); //取得插入基点 Acad::ErrorStatus getBasePt(AcGePoint3d& pt) const; private: AcGePoint3d BasePt;//图形插入基点 AcGePoint3d LeftPointH[7];//左侧后墙的点 AcGePoint3d LeftPointQ[7];//左侧前墙的点 AcGePoint3d RightPointH[7];//右侧后墙的点 AcGePoint3d RightPointQ[7];//右侧前墙的点 AcGePoint3d PMPointH[9];//平面后墙的点 AcGePoint3d PMPointQ[9];//平面前墙的点 }; //zzz.cpp #include "stdafx.h" #include "zzz.h" #include "dbmain.h" ACRX_DXF_DEFINE_MEMBERS(CbzqCLASS, AcDbEntity, 15, 0, AcDbProxyEntity::kColorChangeAllowed, ASDKACLINE, ASDKACLINE); CbzqCLASS::CbzqCLASS() { BasePt.set(0.0,0.0,0.0);//init基点 } CbzqCLASS::~CbzqCLASS() { ;// } //指定基点 Acad::ErrorStatus setBasePt(const AcGePoint3d pt) { assertWriteEnabled(); BasePt = pt; return Acad::eOk; } 正在编译... zzz.cpp c:\documents and settings\ab\my documents\visual studio 2005\projects\arxprojectrrrr\arxprojectrrrr\zzz.cpp(20) : error C3861: 'assertWriteEnabled': identifier not found c:\documents and settings\ab\my documents\visual studio 2005\projects\arxprojectrrrr\arxprojectrrrr\zzz.cpp(21) : error C2065: 'BasePt' : undeclared identifier 生成日志保存在“file://c:\Documents and Settings\ab\My Documents\Visual Studio 2005\Projects\ArxProjectrrrr\ArxProjectrrrr\Debug\BuildLog.htm” ArxProjectrrrr - 2 个错误,0 个警告 ========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ========== 注掉 assertWriteEnabled(); 注掉 BasePt = pt; 能通过编译又出错如下: zzz.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall CbzqCLASS::worldDraw(class AcGiWorldDraw *)" (?worldDraw@CbzqCLASS@@UAEHPAVAcGiWorldDraw@@@Z) ..... .... Debug/xxyArxProjectrrrr.arx : fatal error LNK1120: 7 个无法解析的外部命令
为什么啊?是不是类不能这样申明?还是别的什么问题?请指点一下,都二天了,还没搞好。 |