Apache Log4CXX is a logging framework for C++ patterned after Apache log4j. It also happens to be quite difficult to build on Windows if you are using Microsoft Windows SDK 1.0 (AKA Microsoft Platform SDK 6.0). If you are building software for Windows Vista or Windows Server 2008, or using Visual C++ 2008, you are using Windows SDK 1.0.
The reason Log4CXX 0.10.0 is hard to compile with Windows SDK 1.0 is a bug in APR 1.2.12 (the latest version available as of this writing) and a bug in Windows SDK 1.0 itself (a preprocessor redefinition due to including twice a header file). Here comes the recipe in case you want to build the stuff yourself:
- Download APR 1.2.12 and extract it. Rename to apr.
- Download APR Util 1.2.12 and extract it. Rename to apr-util.
- Download Log4CXX 0.10.0 and extract it
- Download GNU Sed and install it
- Open cmd.exe and run %PROGRAMFILES%Microsoft Visual Studio 9.0VCvcvarsall.bat
- Apply the apr-1.2.12-win32.patch patch to fix bug 40398 in APR 1.2.12 (this step is not needed if you are using APR 1.2.13)
- Apply the log4cxx-0.10.0-vc90-support.patch patch
- Enter directory apache-log4cxx-0.10.0
- Execute configure.bat
- Execute configure-aprutil.bat
- Open the log4cxx.dsw solution When asked to convert the solution to VC++9, click Yes to All.
- Right click on Solution log4cxx and select Build solution