Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Build
    • Labels:
      None
    • Environment:
      MS Windows XP
      MS Visual Studio 8 SP1
      apache-ant-1.7.0

      Description

      log4cxx revision is (608277)

      When I compile it under VS 8 SP1 I get this message:

      [cc] D:\Projects\Libraries\apache-log4cxx\src\main\cpp\simpledateformat.cpp(126) : error C2661: 'std::time_put<_Elem,_OutIt>::put' : no overloaded function takes 4 arguments
      [cc] with
      [cc] [
      [cc] _Elem=wchar_t,
      [cc] _OutIt=std::ostreambuf_iterator<wchar_t,std::char_traits<wchar_t>>
      [cc] ]
      [cc] D:\Projects\Libraries\apache-log4cxx\src\main\cpp\simpledateformat.cpp(138) : error C2661: 'std::time_put<_Elem,_OutIt>::put' : no overloaded function takes 4 arguments
      [cc] with
      [cc] [
      [cc] _Elem=char,
      [cc] _OutIt=std::ostreambuf_iterator<char,std::char_traits<char>>
      [cc] ]

      Revision #598875 builds without problem.

        Activity

        Hide
        Curt Arnold added a comment -

        Visual C++ 6 provided an implementation of std::time_put<>::put that took 4 arguments instead of the 5 in the standard. It also provided _HAS and _USE macros that provided the equivalent of std::has_facet and std::use_facet templates. It appears that VS 8 SP 1 may have removed the VC 6 compatible version of std::time_put<>::put.

        I have not explored where in the progression from VC 6 to 2008 that the standard implementation was added and when the VC 6 implementation was removed. If you know, you could tweak the definitions of _HAS, _USE and _PUT so that the STL definitions are used with VC 8 SP 1 and the VC6 definitions are used with VC versions that did not implement the standard.

        Show
        Curt Arnold added a comment - Visual C++ 6 provided an implementation of std::time_put<>::put that took 4 arguments instead of the 5 in the standard. It also provided _HAS and _USE macros that provided the equivalent of std::has_facet and std::use_facet templates. It appears that VS 8 SP 1 may have removed the VC 6 compatible version of std::time_put<>::put. I have not explored where in the progression from VC 6 to 2008 that the standard implementation was added and when the VC 6 implementation was removed. If you know, you could tweak the definitions of _HAS, _USE and _PUT so that the STL definitions are used with VC 8 SP 1 and the VC6 definitions are used with VC versions that did not implement the standard.
        Hide
        Alexander E. Sorokin added a comment -

        I make that tweak

        ====
        #if !defined(_USE)
        #define _USE(locale, type) std::use_facet < type >(locale)
        #define _PUT(facet,os, time, spec) facet.put(os, os, os.fill(), time, spec)
        #elif _MSC_VER >= 1400
        #define _PUT(facet, os, time, spec) facet.put(os, os, L' ', time, 'x', spec);
        #else
        #define _PUT(facet, os, time, spec) facet.put(os, os, time, spec)
        #endif
        ====

        That helps me to compile head revision. But compile doesn't mean work - I tried to check this tweak and write simple code into Win32 Shared DLL project:

        ===
        LoggerPtr rootLogger = Logger::getRootLogger();
        LOG4CXX_INFO( rootLogger, "Library" );
        ===

        This code works well on revision 598875, but on head revision I have runtime error - entry point not found:

        ===
        ?getInfo@Level@log4cxx@@SA?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ
        ===

        Show
        Alexander E. Sorokin added a comment - I make that tweak ==== #if !defined(_USE) #define _USE(locale, type) std::use_facet < type >(locale) #define _PUT(facet,os, time, spec) facet.put(os, os, os.fill(), time, spec) #elif _MSC_VER >= 1400 #define _PUT(facet, os, time, spec) facet.put(os, os, L' ', time, 'x', spec); #else #define _PUT(facet, os, time, spec) facet.put(os, os, time, spec) #endif ==== That helps me to compile head revision. But compile doesn't mean work - I tried to check this tweak and write simple code into Win32 Shared DLL project: === LoggerPtr rootLogger = Logger::getRootLogger(); LOG4CXX_INFO( rootLogger, "Library" ); === This code works well on revision 598875, but on head revision I have runtime error - entry point not found: === ?getInfo@Level@log4cxx@@SA?AV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@XZ ===
        Hide
        Alexander E. Sorokin added a comment -

        I found a reason for runtime error - there was old log4cxx.dll in my %PATH% variable. When I updated %PATH% I maked sure that my tweak works well.

        So, question is "When that tweak will be added to svn?"

        Show
        Alexander E. Sorokin added a comment - I found a reason for runtime error - there was old log4cxx.dll in my %PATH% variable. When I updated %PATH% I maked sure that my tweak works well. So, question is "When that tweak will be added to svn?"
        Hide
        Curt Arnold added a comment -

        Commited a change in rev 608526 so that the non-standard VC6 facet macros and put method are used only with VC6 since the standard appears to be correctly implemented in VC 7 aka VS.Net aka VS.NET 2001.

        Show
        Curt Arnold added a comment - Commited a change in rev 608526 so that the non-standard VC6 facet macros and put method are used only with VC6 since the standard appears to be correctly implemented in VC 7 aka VS.Net aka VS.NET 2001.
        Hide
        Alexander E. Sorokin added a comment -

        Ok, now it works

        Show
        Alexander E. Sorokin added a comment - Ok, now it works

          People

          • Assignee:
            Curt Arnold
            Reporter:
            Alexander E. Sorokin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development