logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: log4cxx-0.10.0 - adding a custom appender
Date Mon, 03 Dec 2007 07:15:14 GMT

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 "
> (__imp_?instanceof@EMSAppender@@UBE_NABVClass@helpers@log4cxx@@@Z)
> referenced in function "[thunk]:public: virtual bool __thiscall
> EMSAppender::instanceof`vtordisp{4294967292,0}' (class
> log4cxx::helpers::Class const &)const "
> (?instanceof@EMSAppender@@ 
> $4PPPPPPPM@A@BE_NABVClass@helpers@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@@UAEPAXI@Z)	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.

View raw message