Log4cplus is a C + + written open source of the log system, the function is very comprehensive, the use of their own development of the project will be more professional. This article describes the configuration of Log4cplus in VS2005.
First download the Log4cplus source code (I am using version 1.03). There are log4cplus_dll in the solution, and log4cplus two projects generate dynamic link version, and static link version respectively. The options in the compilation are debug,debug_unicode,release,release_unicode. Take dynamic links as an example eventually production log4cplus.dll,log4cplus.lib (release version), Log4cplusd.dll,log4cplusd.lib (Debug edition), Log4cplusu.dll,log4cplusu.lib (Release,unicode edition), Log4cplusUD.dll, Log4cplusUD.lib (Debug,unicode edition). Users choose different lib and DLL combinations depending on their needs.
The following is a log4cplusu.dll,log4cplusu.lib (Release,unicode version), for example, to illustrate the configuration in VS2005.
1. In the project (with the. sln file in the same level directory) to create the Include folder, the Log4cplus folder into the Log4cplus, set up lib file log4cplusU.lib into the folder, in the release put Log4cplusU.dll.
2. In the property-> General-> character Set, select Use Unicode if the non-Unicode version of the Select multiple character set.
3. Add to the-> general-> of the attribute->c/c++ the Include directory. /include
4. In the property->c/c++-> code generation-> Run-time Library is set to/MDD
5. Add in the Properties-> Linker-> General-> Additional Library directory ... /lib
6.-> Enter-> Additional dependencies in the property-> linker log4cplusU.lib
In the configuration, be aware of the separate configuration of the debug and Unicode versions, and use a version that matches the character set settings.