Need help compiling on MSVC 2005. I checked out the code from the CVS a while ago and compiling sources in msvc7 directory and always get the following error in both ( 7.1 and 8.0 )
Thanks , Actually the testNTEventLog project was generating the error. Once I added the localtime hh/cpp files to the Log4cppLib project . All works okay now.
On a different note , which lib should one be linking to in their programs log4cpp.lib or log4cpplib.lib
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Need help compiling on MSVC 2005. I checked out the code from the CVS a while ago and compiling sources in msvc7 directory and always get the following error in both ( 7.1 and 8.0 )
log4cpplib.lib(PatternLayout.obj) : error LNK2019: unresolved external symbol "void __cdecl log4cpp::localtime(__int64 const *,struct tm *)" (?localtime@log4cpp@@YAXPB_JPAUtm@@@Z) referenced in function "public: virtual void __thiscall log4cpp::TimeStampComponent::append(class std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> > &,struct log4cpp::LoggingEvent const &)" (?append@TimeStampComponent@log4cpp@@UAEXAAV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABULoggingEvent@2@@Z)
I don't have msvc7 or 7.1 to check, but think that solution is easy. You need to add to msvc log4cpp project Localtime.cpp from src directory.
Thanks , Actually the testNTEventLog project was generating the error. Once I added the localtime hh/cpp files to the Log4cppLib project . All works okay now.
On a different note , which lib should one be linking to in their programs log4cpp.lib or log4cpplib.lib
They're all linkin to log4cpplib.lib .. Thanks dark-angel.
To work properly you should link with DLL export library unless you really need to link with static version. I think you should link with log4cpp.lib.