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 in my project, unresolved symbols despite hours of work
Date Tue, 27 Nov 2007 21:28:02 GMT

On Nov 27, 2007, at 3:07 PM, Eborn, Eric D wrote:

> I’m using MSVC 2008 Express Edition.  I downloaded the SVN head  
> today and built it fine (after some wrestling with it), and was able  
> to use log4cxx in one project without much problem, however, I then  
> ported some of the code I had over into another MSVC project and  
> again tried to integrate log4cxx and am getting a couple of errors  
> that are stumping me:
>
> Linking...
>    Creating library .\Release/Camera.lib and object .\Release/  
> Camera.exp
> Camera.obj : error LNK2019: unresolved external symbol "public:  
> static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>  
> const & __stdcall log4cxx::Level::getInfo(void)" (? 
> getInfo@Level@log4cxx@@SGABV? 
> $ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ) referenced in function  
> "int __stdcall convert(unsigned char *,int &,int &)" (? 
> convert@@YGHPAEAAH1@Z)
> Camera.obj : error LNK2019: unresolved external symbol "public:  
> static class log4cxx::helpers::ObjectPtrT<class log4cxx::Logger>  
> __stdcall log4cxx::Logger::getLogger(char const * const)" (? 
> getLogger@Logger@log4cxx@@SG?AV? 
> $ObjectPtrT@VLogger@log4cxx@@@helpers@2@QBD@Z) referenced in  
> function "void __cdecl `dynamic initializer for 'logger''(void)" (?? 
> __Elogger@@YAXXZ)
> ..\Bin\Camera.ax : fatal error LNK1120: 2 unresolved externals
>
> I built the log4cxx.lib both statically and dynamically and the  
> above output is when I use the shared lib, I’ve also added the Pre- 
> processor directive LOG4CXX_STATIC.
>
> I’ve done everything I can think of to get this right and this  
> mailing list is my last resort ☺  I’d hate to waste your time.
>
>
>
>
>
> Eric Eborn,
> Software Engineer
> 801-545-5449
> eric.d.eborn@lmco.com
>
>


You should only set LOG4CXX_STATIC when you are linking against a  
static log4cxx library.  Your message suggests that you set and tried  
to link against a shared library which I would guess would result in  
the types of messages that you see (I'd expect a declspec(import) to  
show up in the method signature if LOG4CXX_STATIC was not set).  Could  
you confirm that your LOG4CXX_STATIC setting is consistent with the  
type of log4cxx library that you are linking against?


Mime
View raw message