Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-2119

warning C4251: 'xercesc_3_2::TranscodeToStr::fString': class 'xercesc_3_2::ArrayJanitor<XMLByte>' needs to have dll-interface to be used by clients of class 'xercesc_3_2::TranscodeToStr'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.1, 3.2.2
    • Utilities
    • None
    • windows
    • Patch

    Description

      Upgrading from xerces 3.1.2 to 3.2.0 on windows introduces a few of

      (...)\include\xercesc/util/TransService.hpp(559): error C2220: warning treated as error - no 'object' file generated
      (...)\include\xercesc/util/TransService.hpp(559): warning C4251: 'xercesc_3_2::TranscodeToStr::fString': class 'xercesc_3_2::ArrayJanitor<XMLByte>' needs to have dll-interface to be used by clients of class 'xercesc_3_2::TranscodeToStr'
      (...)\include\xercesc/util/TransService.hpp(559): note: see declaration of 'xercesc_3_2::ArrayJanitor<XMLByte>'
      (...)\include\xercesc/util/TransService.hpp(641): warning C4251: 'xercesc_3_2::TranscodeFromStr::fString': class 'xercesc_3_2::ArrayJanitor<XMLCh>' needs to have dll-interface to be used by clients of class 'xercesc_3_2::TranscodeFromStr'
      (...)\include\xercesc/util/TransService.hpp(641): note: see declaration of 'xercesc_3_2::ArrayJanitor<XMLCh>'
      

      As pragma deactivating C4251 is frown upon on the project I work, I ended up exporting the types, see attached patch.
      Note that this was also mentioned in XERCESC-1974.

      Attachments

        1. dll_interface.patch
          0.6 kB
          Mathieu Champlon
        2. 0001-Explicitly-export-ArrayJanitor-templates.patch
          6 kB
          Roger Leigh

        Activity

          People

            rleigh Roger Leigh
            mat Mathieu Champlon
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: