I am trying to use log4cplus as a logger in my project. I have download and compiled log4cplus in VS2013 both 'Debug_Unicode' and 'Release_Unicode' successfully (project compiles successfully in Release and Debug).
In my 'Project Properties->Configuration Properties' I have added:
- 'log4cplus\include' to the 'C/C++->All Options->Additional Include Directories'
- 'log4cplus\msvc10\Win32\obj.log4cplus.Release_Unicode' to the 'Linker->All Options->Additional Library Directories'
- 'log4cplusu.lib' in the 'Linker->All Options->Additional Dependencies'
I have also made sure that I am using the same Runtime Library, in my case Multi-threaded DLL (/MD), in both the log4cplus project as well as in my own project.
But when I try to build my project I am getting the following link errors:
error LNK2001: unresolved external symbol "class std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> > & __cdecl log4cplus::detail::get_macro_body_oss(void)" (?get_macro_body_oss@detail@log4cplus@@YAAAV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) error LNK2001: unresolved external symbol "void __cdecl log4cplus::detail::macro_forced_log(class log4cplus::Logger const &,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *,int,char const *)" (?macro_forced_log@detail@log4cplus@@YAXABVLogger@2@HABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDH2@Z) fatal error LNK1120: 2 unresolved externals