How to compile Apache log4cxx with Visual Studio 2012

I was searching for a suitable logging library. Previously, I was using log4cpp but I want to use the Apache logging library. First you have to compile:
– Apr -> libapr-1.dll
– AprIconv -> libapriconv-1.dll
– AprUtil -> libaprutil-1.dll
– expat -> expat.dll
and then log4cxx -> log4cxx.dll.
The problem is that log4cxx use a macro for defining a vector<> template based stuff. All the macros named LOG4CXX_LIST_DEF should be moved from the end of the headers to the top of the header. There are about 20 entries to move.
Another problem is to remove the namespace from the KeySet class. Every time there is scope::KeySet, you should write KeySet only.
After 1 or 2 hours fixing the errors, you should be ok to recompile this library. Size of log4cxx.dll is 4MB (debug mode).



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: