Qpid
  1. Qpid
  2. QPID-2371

Missing includes for MSVC 2005 compiler

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.7
    • Component/s: C++ Broker
    • Labels:
      None
    • Environment:

      MSVC 2005

      Description

      When compiling the 0.6 release candidate using MSVC 2005 I found some missing header file includes that prevented qpid to compile out of the box. I'll add a patch later.
      Also I had to add "/D _WIN32_WINNT=0x0501" to the compiler flags during cmake makefile generation to prevent compile errors in various components, but I've no idea how to add this to the cmake configuration.

      1. msvc2005.patch
        0.8 kB
        Marcel Roelofs

        Activity

        Hide
        Steve Huston added a comment -

        Fixed on trunk r907733.

        Show
        Steve Huston added a comment - Fixed on trunk r907733.
        Hide
        Marcel Roelofs added a comment -

        It's not really pervasive, it's needed to get mssql_store and qpidxarm compiled properly. The first component has its own cmakefile where you could add the extra define, but the latter is generated via the cmakefile to which I suggested the change (for that particular reason).

        Your change works fine as well, it's just my non-fluency in cmake that made me come up with my less sophisticated solution.

        With the exception of the ResilientConnection.cpp compilation (that was subject of QPID-1982), it seems we're there now to get everything to compile and link properly using VC8. In case you're interested, in ResilientConnection.cpp the problem was the write function not being declared anywhere. If that's relevant information for QPID-1982, I would add it as a comment there, and close this jira.

        Show
        Marcel Roelofs added a comment - It's not really pervasive, it's needed to get mssql_store and qpidxarm compiled properly. The first component has its own cmakefile where you could add the extra define, but the latter is generated via the cmakefile to which I suggested the change (for that particular reason). Your change works fine as well, it's just my non-fluency in cmake that made me come up with my less sophisticated solution. With the exception of the ResilientConnection.cpp compilation (that was subject of QPID-1982 ), it seems we're there now to get everything to compile and link properly using VC8. In case you're interested, in ResilientConnection.cpp the problem was the write function not being declared anywhere. If that's relevant information for QPID-1982 , I would add it as a comment there, and close this jira.
        Hide
        Steve Huston added a comment -

        Thanks for checking into this, Marcel. I'd rather not lock this in for every build. Can do please check where this is needed? If it's pervasive, please try this change to cpp/src/CMakeLists.txt instead:

        Index: CMakeLists.txt
        ===================================================================
        — CMakeLists.txt (revision 905160)
        +++ CMakeLists.txt (working copy)
        @@ -409,6 +409,9 @@
        /wd4800
        /wd4355
        )
        + if (MSVC80)
        + add_definitions(/D "_WIN32_WINNT=0x0501")
        + endif (MSVC80)
        endif (MSVC)

        set (qpidcommon_platform_SOURCES

        Show
        Steve Huston added a comment - Thanks for checking into this, Marcel. I'd rather not lock this in for every build. Can do please check where this is needed? If it's pervasive, please try this change to cpp/src/CMakeLists.txt instead: Index: CMakeLists.txt =================================================================== — CMakeLists.txt (revision 905160) +++ CMakeLists.txt (working copy) @@ -409,6 +409,9 @@ /wd4800 /wd4355 ) + if (MSVC80) + add_definitions(/D "_WIN32_WINNT=0x0501") + endif (MSVC80) endif (MSVC) set (qpidcommon_platform_SOURCES
        Hide
        Marcel Roelofs added a comment -

        Steve, everything compiles out of the box with the patch to the cmakefile below. The extra define specifies that the compiler targets Windows XP and Windows Server 2003; it's necessary to pull some extra declarations into the Windows header files that are needed to compile qpid. Apparently this (or better) is already the default for VC9 but not for VC8. If the default for VC9 is higher than I guess taking the VC9 default value won't hurt either.

        — cpp/src/CMakeLists.txt (revision 904026)
        +++ cpp/src/CMakeLists.txt (working copy)
        @@ -404,6 +404,7 @@
        /D "NOMINMAX"
        /D "WIN32_LEAN_AND_MEAN"
        /D "_SCL_SECURE_NO_WARNINGS"
        + /D _WIN32_WINNT=0x0501
        /wd4244
        /wd4800
        /wd4355

        Show
        Marcel Roelofs added a comment - Steve, everything compiles out of the box with the patch to the cmakefile below. The extra define specifies that the compiler targets Windows XP and Windows Server 2003; it's necessary to pull some extra declarations into the Windows header files that are needed to compile qpid. Apparently this (or better) is already the default for VC9 but not for VC8. If the default for VC9 is higher than I guess taking the VC9 default value won't hurt either. — cpp/src/CMakeLists.txt (revision 904026) +++ cpp/src/CMakeLists.txt (working copy) @@ -404,6 +404,7 @@ /D "NOMINMAX" /D "WIN32_LEAN_AND_MEAN" /D "_SCL_SECURE_NO_WARNINGS" + /D _WIN32_WINNT=0x0501 /wd4244 /wd4800 /wd4355
        Hide
        Steve Huston added a comment -

        I changed the fix version to 0.7. 0.6 is in the release process and can't be held back for this issue since this is not a regression from 0.5.

        Show
        Steve Huston added a comment - I changed the fix version to 0.7. 0.6 is in the release process and can't be held back for this issue since this is not a regression from 0.5.
        Hide
        Steve Huston added a comment -

        The <winsock2.h> inclusion from the patch is committed at revision: 904563

        Marcel, please let us know anything else that needs to get done to fix the MSVC 2005 build.

        Show
        Steve Huston added a comment - The <winsock2.h> inclusion from the patch is committed at revision: 904563 Marcel, please let us know anything else that needs to get done to fix the MSVC 2005 build.
        Hide
        Steve Huston added a comment -

        I'm testing the patch adding <winsock2.h> and will commit for 0.7 if all is well with the vc9 build.

        I'm not going to apply the patch for ResilientConnection.cpp - that is the subject of another jira, QPID-1982 and should be resolved in a more portable manner. For now you can ignore that piece of Qpid.

        Please update this jira if you learn more about the _WIN32_WINNT requirement. I test the build daily on VC9 (Win XP and XP-64) without the need for this.

        Show
        Steve Huston added a comment - I'm testing the patch adding <winsock2.h> and will commit for 0.7 if all is well with the vc9 build. I'm not going to apply the patch for ResilientConnection.cpp - that is the subject of another jira, QPID-1982 and should be resolved in a more portable manner. For now you can ignore that piece of Qpid. Please update this jira if you learn more about the _WIN32_WINNT requirement. I test the build daily on VC9 (Win XP and XP-64) without the need for this.
        Hide
        Marcel Roelofs added a comment -

        Missing includes for MSVC 2005 compilation

        Show
        Marcel Roelofs added a comment - Missing includes for MSVC 2005 compilation

          People

          • Assignee:
            Steve Huston
            Reporter:
            Marcel Roelofs
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development