log4cpp 1.0 - VS2005Express

Help
2007-09-26
2013-05-20
  • Nicholas Yue
    Nicholas Yue
    2007-09-26

    Hi,

      I was able to compile the static version of log4cpp but had linker problems with the DLL version. Any suggestion? For now I am using the static library version.

    RemoteSyslogAppender.obj : error LNK2001: unresolved external symbol "public: class std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,0> >::const_iterator __thiscall log4cpp::FactoryParams::find(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?find@FactoryParams@log4cpp@@QBE?AVconst_iterator@?$_Tree@V?$_Tmap_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@$0A@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@@Z)

    Regards

     
    • Aaron Shetlar
      Aaron Shetlar
      2007-10-11

      Hello,

      I'm using VS2005 and encountered the same problem. After much head-scratching, I noticed that the class "log4cpp::FactoryParams" mentioned in the error message is not included in the project. Adding FactoryParams.cpp to the project fixed the problem. This may be a bug in the msvc6 project files for both the static library and the dll.

      Hope this helps.

       
    • Aaron Shetlar
      Aaron Shetlar
      2007-10-11

      Same thing for Localtime.cpp.

       
    • NICK LUE
      NICK LUE
      2008-03-07

      HI

      I have a similar problem when i link the testmain project.

      log4cpp.lib(FileAppender.obj) : error LNK2019: unresolved external symbol "public: class std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,0> >::const_iterator __thiscall log4cpp::FactoryParams::find(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?find@FactoryParams@log4cpp@@QBE?AVconst_iterator@?$_Tree@V?$_Tmap_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@$0A@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@@Z) referenced in function "public: class log4cpp::details::required_params_validator const & __thiscall log4cpp::details::required_params_validator::operator()<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)const " (??$?RV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@required_params_validator@details@log4cpp@@QBEABV012@PBDAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

      regards

       
    • kirill_lykov
      kirill_lykov
      2008-09-15

      You should just look at the log4cpp::FactoryParams::find)))
      It is a template method but it has implementation in cpp file, try to make it inline - you should copy code implemenation for this method from cpp file to header. Thats all.