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

building for Windows-XP AMD64 has compile errors and warnings

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.0
    • 2.8.0
    • Build
    • None
    • Windows XP AMD64 built with Visual Studio 2005 Final Version

    Description

      David Dunkle wrote:
      > We would like a working xerces-C++ for Windows XP 64, specifically
      > AMD64. I am starting to try to build the source for this platform
      > using Visual Studio 8 (Visual Studio 2005 - the final version), and I
      > have some questions.
      >
      > 1) I have seen one or two other people asking about this in the email
      > archives, but before I go to far, I would like to know if anyone has
      > gotten a functional xerces for 64 bit Windows.
      > 2) We would like to build with VC8, but there is no VC8 project in the
      > 2.7.0 release. Should we plan on creating one?
      > 3) I have most of the subprojects now compiling and linking for me,
      > without changing any source, but I still see 3 compile errors and many
      > disturbing compiler warnings.
      >
      > The warnings:
      >
      > The most bothersome warnings seem to me to be those where "long" is
      > assumed to be 64 bits; on this platform, I believe that long is 32
      > bits even though pointers are 64. At least according to Microsoft's
      > documentation. An example warning is below, but there are many more.
      >
      > Configuration: Debug x64 ------
      > Compiling...
      > PSVIWriterHandlers.cpp
      > ..\..\..\..\..\src\xercesc/internal/XSerializeEngine.hpp(818)
      > : warning C4244: 'return' : conversion from '__int64'
      > to 'unsigned long', possible loss of data
      >

      I've already prepared a patch for this warning, but it means a change in the public API, so it cannot go in until the 3.0 release. For the time being, you can ignore it.

      > Is there a some way to deal with these kind of warnings that I don't
      > understand built into xerces, or should we plan on changing the
      > source? The problem seems pretty systemic.
      >
      > Here are the errors.
      >
      > Are there known solutions for these errors or should we plan on fixing
      > the xerces source?
      >
      > ------ Build started: Project: PSVIWriter,
      > Configuration: Debug x64 ------
      > Compiling...
      ...

      > ..\..\..\..\..\samples\PSVIWriter\PSVIWriterHandlers.cpp(1617)
      > : error C2440: 'type cast' : cannot convert from
      > 'xercesc_2_7::XSObject *' to 'unsigned long'
      > The target is not large enough

      The fix for this is a bit complicated, so I'll have to work on a fix for this.

      > Build log was saved at
      > "file://c:\ddunkleworkspace\mytests\xerces-c-src_2_7_0\Projects\Win32\VC8\xerces-all\PSVIWriter\x64\Debug\BuildLog.htm"
      > PSVIWriter - 1 error(s), 2 warning(s)
      > ------ Build started: Project: xml4com, Configuration:
      > Debug x64 ------
      > Compiling...
      > XMLHTTPRequest.cpp
      > ..\..\..\..\..\src\xercesc\com\XMLHTTPRequest.cpp(40)
      > : warning C4996: '_tcsncpy' was declared deprecated
      > C:\Program Files (x86)\Microsoft Visual Studio
      > 8\VC\include\tchar.h(1467) : see declaration of '_tcsncpy'
      > Message: 'This function or variable may be unsafe. Consider
      > using _tcsncpy_s instead. To disable deprecation, use
      > _CRT_SECURE_NO_DEPRECATE. See online help for details.'

      This is Microsoft's idea of a joke, I guess. They are trying to become security conscious, so they decided to mark all sort of functions as "deprecated." You can ignore these errors. I will be checking in a fix that disables them.

      Also, I suspect you will have to disable the COM wrappers, because they will probably not build in 64-bit mode. I don't think anyone is even maintaining them now, and I'm not sure if COM can work with 64-bit applications.

      ...

      > Build log was saved at
      > "file://c:\ddunkleworkspace\mytests\xerces-c-src_2_7_0\Projects\Win32\VC8\xerces-all\xerces-com\x64\Debug\BuildLog.htm"
      > xml4com - 2 error(s), 8 warning(s)
      > ------ Build started: Project: MemHandlerTest,
      > Configuration: Debug x64 ------
      > Compiling...
      > SimpleHashPtr.cpp
      > ..\..\..\..\..\tests\MemHandlerTest\SimpleHashPtr.cpp(32)
      > : error C2440: 'type cast' : cannot convert from 'const void *const '
      > to 'long'
      > The target is not large enough

      The fix is to cast size_t instead of long. I will check in a fix for this.

      If you want to track these fixes, feel free to create Jira enhancement request, and I'll make sure to update it when the fixes are in the SVN repository.

      Dave

      Attachments

        1. win64.patch
          6 kB
          Boris Kolpackov
        2. size_t.patch
          305 kB
          Alberto Massari

        Activity

          People

            amassari Alberto Massari
            ddunkle@arxan.com David Dunkle
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: