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 Visual Studio 201*.
1. Download later version of Log4cxx which is Apache Log4cxx 0.10 from here, http://logging.apache.org/log4cxx/download.ht ml
2. Download dependencies from https://archive.apache.org/dist/apr/
3. The official building guideline is quite easy to follow.
1 3 4 5 6 7 |
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 |
4. I recommand you to install Gow in your developer machine and then you'll have many unix/linux like tools, very convenient. Or if you had git, you can add git cmd tools into your env.
configure
configure-aprutil
above 2 cmd requires Sed.exe, install it (gow/git) before excute them.Chapter 2
Building log4cxx 1. Now we had to convert *.DSW to *.cxproj. To make it smooth, just launch Visual Studio 201* and open log4cxx.dsw.VS would ask if you like to convert everything. Simply Click Yes.2. Set Log4cxx as Startup Project.3. Open Project Log4cxx ' s Properties window, add other 3 projects as references, in here:Properties-Common properties, framework and references.4. Hit F7 If- c2252, this is because log4cxx_list_def define error, go to its definition and change it to /c6>
#define LOG4CXX_LIST_DEF (n, T) typedef std::vector<t> N
Like this,
Old
#define LOG4CXX_LIST_DEF (N, T) \
Template class Log4cxx_export std::allocator<t>; \
Template class Log4cxx_export std::vector<t>; \
typedef std::vector<t> N
New
#define LOG4CXX_LIST_DEF (n, T) typedef std::vector<t> N
5. and u'll meet another err about insert_iterator, simply add #include <iterator> to reletive file
6. done! Enjoy your log4cxx!
How to build Apache Log4cxx 0.10 by Visual Studio 201*