logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meongchul Song <mcso...@yahoo.com>
Subject Link error when using Layout on MS Windows
Date Tue, 09 Dec 2008 00:55:32 GMT
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 &)" (??0PatternLayout@log4cxx@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@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

Mime
View raw message