Steps:
- Download log4cxx ZIP package from http://logging.apache.org/log4cxx/download.html, and extract its contents.
- Download latest available apr and apr-util ZIP package from http://apr.apache.org/download.cgi.
- unzip apr-1.x.y-win32-src.zip (manually extract the contents)
- rename apr-1.x.y apr (rename the folder)
- unzip apr-util-1.x.y-win32-src.zip (manually extract the contents)
- rename apr-util-1.x.y apr-util (rename the folder)
- cd apache-log4cxx-0.10.0
- configure
- Open apr-util\include\apu.hw.
- Find the line starting with "#define APU_HAVE_APR_ICONV".
- Change the constant to 0 and save the file.
- Open apr-util\include\apr_ldap.hw.
- Find the line starting with "#define APR_HAS_LDAP".
- Change the constant to 0 and save the file.
- Open VS 2012 and open project log4cxx.dsw.
- Click yes to whatever VS prompts you with (it has something to do with conversion).
- Once the projects have been converted, go to Header Files folder of log4cxx.
- Open log4cxx.h within VS.
- Change line containing "#if defined(_MSC_VER) && !defined(LOG4CXX_STATIC) && defined(LOG4CXX)" to "#if defined(_MSC_VER) && _MSC_VER < 1700 && !defined(LOG4CXX_STATIC) && defined(LOG4CXX)".
- Change line containing "#elif defined(_MSC_VER) && !defined(LOG4CXX_STATIC)" to "#elif defined(_MSC_VER) && _MSC_VER < 1700 && !defined(LOG4CXX_STATIC)".
- Build log4cxx.
Did you actually got it to work? I compiled it but when i try simple examples it throws exceptions. I am running Windows 7 64bit
ReplyDeleteHi, thanks for the tutorial, everything else compiles fine, but i m still seeing these 2 errors:
ReplyDelete3>domconfigurator.obj : error LNK2019: unresolved external symbol _apr_xml_parse_file@20 referenced in function "public: virtual void __thiscall log4cxx::xml::DOMConfigurator::doConfigure(class log4cxx::File const &,class log4cxx::helpers::ObjectPtrT &)" (?doConfigure@DOMConfigurator@xml@log4cxx@@UAEXABVFile@3@AAV?$ObjectPtrT@VLoggerRepository@spi@log4cxx@@@helpers@3@@Z)
3>domconfigurator.obj : error LNK2019: unresolved external symbol _apr_xml_parser_geterror@12 referenced in function "public: virtual void __thiscall log4cxx::xml::DOMConfigurator::doConfigure(class log4cxx::File const &,class log4cxx::helpers::ObjectPtrT &)" (?doConfigure@DOMConfigurator@xml@log4cxx@@UAEXABVFile@3@AAV?$ObjectPtrT@VLoggerRepository@spi@log4cxx@@@helpers@3@@Z)
3>.\Release\log4cxx.dll : fatal error LNK1120: 2 unresolved externals
Can you help?