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
You have to follow these steps to get log4cxx (Version 0.10.0) working with VS2010:
apu.hw in a texteditor of your choice#define APU_HAVE_APR_ICONV, set it to 0 and save the fileapr_ldap.hw from the same directory and find the entry #define APR_HAS_LDAP, set it to 0 and save the file, too.Ok if you hit build now then you will see around 2000 errors and that is where the interesting and "hard" part starts:
Some examples:
// telnetadapter.h
...
typedef log4cxx::helpers::SocketPtr Connection;
LOG4CXX_LIST_DEF(ConnectionList, Connection);
class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton
...
// appender.h
...
class Appender;
LOG4CXX_PTR_DEF(Appender);
LOG4CXX_LIST_DEF(AppenderList, AppenderPtr);
class Layout;
typedef log4cxx::helpers::ObjectPtrT LayoutPtr;
...
class LOG4CXX_EXPORT Appender :
public virtual spi::OptionHandler
{
...
Example:
// old
LoggingEvent::KeySet set;
// new
KeySet set;
If the compiler complains about insert_iterator not being in the namespace std, add #include to the include section of the source file.
Last but not least, right-click on log4cxx project and select Add References and select the other 3 projects as reference
Hope this helps you and some others :) ... if you need the whole solution or other files, let me know!
I figured out these steps with the enormous help of this blog entry by Lex LI.
EDIT: You can download my VS2010 solution and source code from my dropbox: https://www.dropbox.com/s/rn5d0044jzgzwyf/log4cxx_vs2010.7z