lili0602 发表于 2009-12-14 16:26:00

关于自定义类

<table cellspacing="0" cellpadding="0"><tbody><tr><td id="postmessage_17082" class="t_msgfont">&nbsp;&nbsp;&nbsp; 从AcDbObject类继承的自定义类,编译没有问题,连接出现错误:<br/>&nbsp; &nbsp; error LNK2005: "public: static class AcRxClass * __cdecl AsdkObjectToNotify::desc(void)" (?desc@AsdkObjectToNotify@@SAPAVAcRxClass@@XZ) already defined in AsdkObjectToNotify.obj<br/><br/>&nbsp; &nbsp;&nbsp; &nbsp;添加了类初始化宏ACRX_DECLARE_MEMBERS(AsdkObjectToNotify);<br/>&nbsp; &nbsp;&nbsp; &nbsp;和类执行宏<br/>ACRX_DXF_DEFINE_MEMBERS(AsdkObjectToNotify, AcDbObject, AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent, 0, ASDKOBJECTTONOTIFY, persreac);<br/>在初始化消息中添加了AsdkObjectToNotify::rxInit()和acrxBuildClassHierarchy();<br/><br/>&nbsp; &nbsp;&nbsp;&nbsp;请教是什么原因导致的错误呢?谢谢!</td></tr></tbody></table>

溢炜/[!!] 发表于 2012-7-4 10:59:25

我查一了下 据说是库的原因。但我把库文件都加上了 还是不行。
页: [1]
查看完整版本: 关于自定义类