On Dec 2, 2007, at 11:33 PM, Ashfaque wrote:


Hi,

I am trying to add a custom appender using version 0.10.0 of log4cxx. But I
am receiving the following linker errors. Can anyone help me out in
resolving these errors?

Error 25 error LNK2019: unresolved external symbol "__declspec(dllimport)
public: virtual bool __thiscall EMSAppender::instanceof(class
log4cxx::helpers::Class const &)const "
([EMAIL PROTECTED]@@[EMAIL PROTECTED]@log4cxx@@@Z)
referenced in function "[thunk]:public: virtual bool __thiscall
EMSAppender::instanceof`vtordisp{4294967292,0}' (class
log4cxx::helpers::Class const &)const "
([EMAIL PROTECTED]@@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@log4cxx@@@Z)
emsappender.obj 

Error 26 error LNK2019: unresolved external symbol "__declspec(dllimport)
public: void __thiscall EMSAppender::`vbase destructor'(void)"
(__imp_??_DEMSAppender@@QAEXXZ) referenced in function "public: virtual void
* __thiscall EMSAppender::`scalar deleting destructor'(unsigned int)"
(??_GEMSAppender@@[EMAIL PROTECTED])    emsappender.obj 


Thanks,
Ashfaq



Could you provide more details on how you are defining EMSAppender. The header file (or at least a sanitized edition) would be helpful.

The implementation of instanceof() is typically provided by the END_LOG4CXX_CAST_MAP macro or inherited from a base class, such as AppenderSkeleton. Did you derive from AppenderSkeleton (either directly or through another class such as WriterAppender)? If not, I'd recommend inheriting from AppenderSkeleton.

You could also try starting with an existing custom appender (like src/ cpp/vectorappender.h and src/cpp/vectorappender.cpp) and see if you can link it correctly and then modify it to match your EMSAppender.

Reply via email to