I made a Arx program which used overrule mechanism on ObjectArx 2010.I wanted to change the drawing effect about Acdbpoint, so I wrote a class derived from AcGiDrawableOverrule,and overrided the function worldraw().My main codes look just as follow:
//////header file //////////////////////////////////
class DrawOverrule : public AcGiDrawableOverrule
{
public:
ACRX_DECLARE_MEMBERS(DrawOverrule);
...
virtual bool isApplicable(const AcRxObject* pOverruledSubject) const;
virtual Adesk::Boolean worldDraw(AcGiDrawable* pSubject, AcGiWorldDraw * wd);
}
//////cpp file /////////////////////////////////////
ACRX_CONS_DEFINE_MEMBERS(DrawOverrule,AcGiDrawableOverrule,0)
Adesk::Boolean DrawOverrule::worldDraw( AcGiDrawable* pSubject, AcGiWorldDraw * wd )
{
//do something
return Adesk::kTrue;
}
bool DrawOverrule::isApplicable( const AcRxObject* pOverruledSubject ) const
{
return true;
}
/////////////////////////////////////////////////////
When I compiled and builded the project,a link error occured.
acrxEntryPoint.obj : error LNK2001: unresolved external symbol "public: virtual class AcRxClass * __cdecl AcRxOverrule::isA(void)const " (?isA@AcRxOverrule@@UEBAPEAVAcRxClass@@XZ)
AcRxOverrule::isA()? It is Internal class which is offered by objectarx sdk,not my own class.I checked my configure on lib path, it is just all ok.If I made a project without anything refer to overrule mechanism,no error occur. More surprisingly,when I change my lib link to objectArx2012,that link error about AcRxOverrule::isA() will not occur,the compiler wil made success.
I guess that there may be some mistake in released objectarx2010,which I'm not very sure.Anybody else ever met similar problem?
Thanks very much.
Solved! Go to Solution.
Solved by owenwengerd. Go to Solution.
You need to make sure you're including (the correct) acdb18.lib in your Linker -> Input -> Additional Dependencies field.
Thanks very much for your reply.
I am sure that I added acdb18.lib link.Further more,when my program has nothing refer to overrule mechanism,the compiling and linking will be ok.I suspect that there are some mistakes in the released lib file.I hope that I am wrong.
Did anybody else come across this problem? I am confused.
I attach my project here. May you help compile and check it?
Thanks.
I tested your project, and received the same error with the ObjectARX 2010 SDK. It looks like Autodesk forgot to add the function to acdb18.lib. You can define it yourself. For example, add this in your DrawOverrule.cpp:
ACRX_DEFINE_MEMBERS(AcRxOverrule);
How clever you are!haha,Yes,I should defined this macro myself.I tested it,and it worked.
Thanks!you are my master.
Can't find what you're looking for? Ask the community or share your knowledge.