Hello,
I am experiencing a link error when I am trying to add a new logger on the fly.
The code snippet is shown below and it works fine on Linux.
But running on MS Windows causes a link error.
When I commented out two lines indicated by ===>, I don't see any link error.
Changing the PatternLayoutPtr to SimpleLayoutPtr causes similar problem too.
I am using log4cxx 0.10.0 with Visual Studio 2005.
Thank you the help in advance.
Regards,
M. Song
log4cxx::LoggerPtr tmpLogger( log4cxx::Logger::getLogger("SIM.TEST") );
// set logger level
tmpLogger->setLevel( log4cxx::Level::getDebug() );
// set appender properties
===> log4cxx::PatternLayoutPtr layout( new log4cxx::PatternLayout( "%d
%-5p [%l] [%c:%M] %m%n" ) );
log4cxx::FileAppender *ap = new log4cxx::FileAppender;
===> ap->setLayout ( layout );
ap->setFile ( "test.log" );
ap->setAppend ( true );
tmpLogger->addAppender ( ap );
The error message is shown below:
Linking...
1>LoggingTest.obj : error LNK2019: unresolved external symbol "public:
__thiscall log4cxx::PatternLayout::PatternLayout(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
> const &)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@[EMAIL
PROTECTED]@2@@std@@@Z) referenced in function "void __cdecl Example_04(void)"
(?Example_04@@YAXXZ)
1>D:\Projects\build\logging\logging\Debug\logging.exe : fatal error LNK1120: 1
unresolved externals
________________________________________________________
180도 달라진 야후! 메일 - 알아서 척척! 새로운 야후! 메일은 10분에 한번 스스로 새 메시지를 받아온답니다.
http://kr.content.mail.yahoo.com/cgland