Unresolved external symbols with log4cpp 1.0

Help
topena
2008-07-02
2013-05-20
  • topena

    topena - 2008-07-02

    Hi,

    I'm trying to use log4cpp 1.0, but altough I'm able to compile it in VS2003, I'm getting a "unresolved external symbol" in all test projects.

    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)
    .\Release/testCategory.exe : fatal error LNK1120: 1 unresolved externals

    Has anyone had this problem ? I would apriciate some help with this problem.

    António Pena

     
    • edwardt

      edwardt - 2008-07-24

      there 2 files are in the package but not included in the solution files:
      factoryparams.cpp
      and localtime.cpp <<<.. i already forgot if the second file is correct. but i remember the link error is complaining about the not findin the localtime .. if you check the error more clearly, you see that they are in the header files but the implementation are no where to be found in the original solution file. Just add those back and the link error will go away.

      for those errors related to custom build events, they are related to not able to find the mc.link.exe, and rc.exe. just point to the correct path and those will go away too.

      I am using visual studio 2008, but the above may help.

       
  • jshvrsn

    jshvrsn - 2010-01-27

    I'm having the same problem.  Did you ever get it resolved?

     
  • jshvrsn

    jshvrsn - 2010-01-27

    Dang.  Sorry, I didn't see there was already a response explaining the solution.

     
  • Rneela

    Rneela - 2010-08-25

    Hi,
    Could you tell how you were able to compile log4cpp 1.0 in VS2003. I downloaded version 1.0 and tried to open msvc6.dsw project file, it complained that log4cppDLL.dsw is corrupted (same thing for few other solutions).

    When I tried to build log4cpp library, got an error :
    PRJ0019: A tool returned an error code from "Performing Custom Build Step"

    Many other people have run into the same issue and suggested using MSVC7 folder, but this folder has not been packaged in the downloadble source code. Any idea from where I can download MSVC7 folder?

    I have no problem compiling log4cpp-0.2.8 in VS2003. Any help would be appreciated.

     
  • darkangel

    darkangel - 2010-08-26

    To make MSVC solution from scratch you need just add all .cpp files from src directory into the solution. That's all. To build DLL make two defines

    LOG4CPP_HAS_DLL
    LOG4CPP_BUILD_DLL

    In any case using MSVC6 project files should work if you add factoryparams.cpp  and localtime.cpp into the project. If Custom Build Step doesn't works for you - remove it.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks