Log4cxx
  1. Log4cxx
  2. LOGCXX-259

Several appenders fail to compile in Visual Studio 2008

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.10.0
    • Component/s: Appender
    • Labels:
      None
    • Environment:
      Visual Studio 2008 on Windows Vista

      Description

      After an update on March 28th, the files socketappender.cpp, sockethubappender.cpp, socketoutputstream.cpp, and xmlsocketappender.cpp no longer compile. Compiling errors occur on the same section of boilerplate code:

      protected:
      LOG4CXX_LIST_DEF(ByteList, char); // Error occurs within the code generated from this MACRO
      ByteList array;
      SocketPtr socket;

      Error Log:

      >Compiling...
      3>socketappender.cpp
      3>z:\projects\Cerberus\log4cxx\src\main\include\log4cxx/helpers/socketoutputstream.h(53) : error C2960: 'std::allocator<_Ty>' : inconsistent explicit instantiations, a previous explicit instantiation specified 'extern template'
      3> with
      3> [
      3> _Ty=char
      3> ]
      3>sockethubappender.cpp
      3>z:\projects\Cerberus\log4cxx\src\main\include\log4cxx/helpers/socketoutputstream.h(53) : error C2960: 'std::allocator<_Ty>' : inconsistent explicit instantiations, a previous explicit instantiation specified 'extern template'
      3> with
      3> [
      3> _Ty=char
      3> ]
      3>socketoutputstream.cpp
      3>z:\projects\Cerberus\log4cxx\src\main\include\log4cxx/helpers/socketoutputstream.h(53) : error C2960: 'std::allocator<_Ty>' : inconsistent explicit instantiations, a previous explicit instantiation specified 'extern template'
      3> with
      3> [
      3> _Ty=char
      3> ]
      3>xmlsocketappender.cpp
      3>z:\projects\Cerberus\log4cxx\src\main\include\log4cxx/helpers/socketoutputstream.h(53) : error C2960: 'std::allocator<_Ty>' : inconsistent explicit instantiations, a previous explicit instantiation specified 'extern template'
      3> with
      3> [
      3> _Ty=char
      3> ]

      Thanks,
      Grant Averett

        Activity

        Hide
        Curt Arnold added a comment -

        Commited fix in rev 642910.

        Compilation error popped up when the std::vector used for the buffer for socketoutputstream was changed from std::vector<unsigned char> to std::vector<char> to avoid needing to cast when creating a ByteBuffer. Change did not affect VC6, but did seem to affect VC8. For some reason, the declarations of the related allocators used to avoid the warnings described in LOGCXX-219 conflict with some existing definition when the type is char.

        Changed the definition back to unsigned char, but also made the backing buffer private so that it might be changed back some day and since there is no reason why class should have that implementation detail exposed.

        Show
        Curt Arnold added a comment - Commited fix in rev 642910. Compilation error popped up when the std::vector used for the buffer for socketoutputstream was changed from std::vector<unsigned char> to std::vector<char> to avoid needing to cast when creating a ByteBuffer. Change did not affect VC6, but did seem to affect VC8. For some reason, the declarations of the related allocators used to avoid the warnings described in LOGCXX-219 conflict with some existing definition when the type is char. Changed the definition back to unsigned char, but also made the backing buffer private so that it might be changed back some day and since there is no reason why class should have that implementation detail exposed.

          People

          • Assignee:
            Curt Arnold
            Reporter:
            Grant Averett
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.5h
              0.5h
              Remaining:
              Remaining Estimate - 0.5h
              0.5h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development