This is driving me crazy, I\'m trying to building the log4cxx library in order to use in a c++ project I\'ve been using. I\'m on a win7 host running VS2010 express c++ editi
Chapter 1 Official Steps
We are going to follow the steps here, http://logging.apache.org/log4cxx/building/vstudio.html. However, we must make changes to adapt to windows/VS201*.
download later version of log4cxx which is apache log4cxx 0.10 from here, http://logging.apache.org/log4cxx/download.html
download dependencies from https://archive.apache.org/dist/apr/
The official building guideline is quite easy to follow:
unzip apr-1.2.11-win32-src.zip rename apr-1.2.11 apr unzip apr-util-1.2.10-win32-src.zip rename apr-util-1.2.10 apr-util cd apache-log4cxx-0.10.0 configure configure-aprutil
configure configure-aprutil
above 2 cmd requires sed.exe, install it (gow/git) before execute them. or you can change apu.hw and apr_ldap.hw manually:
Open apr_ldap.hw and find the entry #define APR_HAS_LDAP, set it to 0 and save the file, too. Open apu.hw and find the entry #define APU_HAVE_APR_ICONV, set it to 0 and save the file
Chapter 2 Building Log4cxx
Now we have to convert *.dsw to *.cxproj. To make it smooth, just launch Visual Studio 201* and open log4cxx.dsw. VS will ask if you like to convert everything. Simply click Yes.
Set log4cxx as startup project.
#define LOG4CXX_LIST_DEF(N, T) typedef std::vectorN
like this,
old:
#define LOG4CXX_LIST_DEF(N, T) \ template class LOG4CXX_EXPORT std::allocator; \ template class LOG4CXX_EXPORT std::vector ; \ typedef std::vector N
new:
#define LOG4CXX_LIST_DEF(N, T) typedef std::vectorN
and u will meet another err about insert_iterator, simply add #include< iterator> to relative file
Done! enjoy your log4cxx!