logging-log4cxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Log C++ Linker problem.
Date Tue, 04 Jan 2005 20:04:42 GMT
Are you building against log4cxx 0.9.7 or a CVS build?  What version of 
Visual C++ are you using?

The CVS is just recovering from some major surgery, but I was still 
able to compile and link examples/trivial.cpp with a fairly simple VC 6 
project.  Basically, create trivial.dsw in \logging-log4cxx\examples, 
add ..\include to the include path, add ..\build\log4cxxd.lib or 
..\build\log4cxx.lib to the library modules for debug and release 
configurations respectively, and set the debug working build to 
..\build.  I did get an RTL heap debugging warning on the call to 
NDC::pop which I will have to investigate, but everything else seemed 
to work.  I have uploaded the project to 
http://home.houston.rr.com/curta/trivial.tar.gz.

You should avoid using the _T() macro.  It is no longer needed by the 
CVS version which accepts either char or wchar_t based arguments on the 
public API.  It would be slightly more efficient to use wchar_t 
literals, so it would be slightly better to do:

NDC::push(L"trivial context");
LOG4CXX_DEBUG(rootLogger, L"debug message");

than

NDC::push("trivial context");
LOG4CXX_DEBUG(rootLogger, "debug message");

but you can choose whatever string type works best for your 
application.  If you are using log4cxx-0.9.7, the wchar_t methods are 
not available.


Mime
View raw message