ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcTrayItem Linker Errors

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
jason.teagle
601 Views, 4 Replies

AcTrayItem Linker Errors

I am trying to derive a class from AcTrayItem, as indicated in the documentation, but even the simplest class that calls Add, Remove or Update on the status bar will not compile - it shows a linker error referencing AcTrayItemAnimationControl. When I go to the docs for that clas, it says for internal use only. I am compiling for AutoCAD 2010, but AcTrayItem hasbeen available since AutoCAD 2007 and the 2013 documentation shows no new material on how to use it.

 

Can anyone suggest how to overcome this linker error? It appears to be caused by the destructor of the AcTrayItem class.

 

(Simply try deriving your own class from AcTrayItem and compile it.)

 

4 REPLIES 4
Message 2 of 5
owenwengerd
in reply to: jason.teagle

I am not able to reproduce the problem.

--
Owen Wengerd
ManuSoft
Message 3 of 5
jason.teagle
in reply to: owenwengerd

I've created a brand new project using the ObjectARX wizards for VS 2008 / AutoCAD 2012, and added the derived AcTrayItem class. Same problem. The project is attached. It is listing acad.lib and acedapi.lib for linking. The latter lib is the one that mentions AcTrayItemAnimationControl but I still get this linker error:

 

(32-bit Debug compile: )

Error 1 error LNK2019: unresolved external symbol "public: __thiscall AcTrayItemAnimationControl::~AcTrayItemAnimationControl(void)" (??1AcTrayItemAnimationControl@@QAE@XZ) referenced in function __unwindfunclet$??0AcTrayItem@@QAE@ABV0@@Z$0 ConDTrayIcon.obj

 

(64-bit Debug compile: )

Error 1 error LNK2019: unresolved external symbol "public: __cdecl AcTrayItemAnimationControl::~AcTrayItemAnimationControl(void)" (??1AcTrayItemAnimationControl@@QEAA@XZ) referenced in function "int `public: __cdecl AcTrayItem::AcTrayItem(class dtor$1 const &)'::`1'::dtor$1" (?dtor$1@?0???0AcTrayItem@@QEAA@AEBV0@@Z@4HA) ConDTrayIcon.obj

 

 

Message 4 of 5
owenwengerd
in reply to: jason.teagle

It does appear that Autodesk forgot to include the implementation of the AcTrayItemAnimationControl destructor. It looks to me like the desctuctor can be optimized out under normal circumstances, but your AFX_EXT_CLASS macro forces it to be implemented. After removing the AFX_EXT_CLASS macro, your code compiles and links without error.

 

If you must export the class, just add a do-nothing destructor implementation in one of your source files:

AcTrayItemAnimationControl::~AcTrayItemAnimationControl() {}

 

--
Owen Wengerd
ManuSoft
Message 5 of 5
jason.teagle
in reply to: owenwengerd

Brilliant, thank you for taking the time to look at this. 

 

(I didn't know I could simply define my own destructor for their class - thought that would create all kinds of havoc!) 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost