Details

    • Type: Improvement Improvement
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.7
    • Fix Version/s: Future
    • Component/s: C++ Broker
    • Labels:
    • Environment:

      visual studio 2010 c++ express

      Description

      nmake compile failed at

      C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(142) : error C2039: 'value_type' : is not a memb
      er of 'qpid::framing::List'
      C:\A.svn_qpid\cpp\include\qpid/framing/List.h(40) : see declaration of 'qpid::framing::List'
      C:\A.svn_qpid\cpp\src\qpid\amqp_0_10\Codecs.cpp(51) : see reference to class template instantiation 'std::insert
      _iterator<_Container>' being compiled
      with
      [
      _Container=qpid::framing::List
      ]
      C:\svn_qpid\cpp\src\qpid\amqp_0_10\Codecs.cpp(83) : see reference to function template instantiation 'void qpi
      d::amqp_0_10::convert<qpid::types::Variant::List,qpid::framing::List,boost::shared_ptr<T>(__cdecl *)(const qpid::types::
      Variant &)>(const std::list<_Ty> &,U &,F)' being compiled
      with
      [
      T=qpid::framing::FieldValue,
      _Ty=qpid::types::Variant,
      U=qpid::framing::List,
      F=boost::shared_ptr<qpid::framing::FieldValue> (__cdecl *)(const qpid::types::Variant &)
      ]
      C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(149) : error C2182: '_Val' : illegal use of type
      'void'
      C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iterator(156) : error C2182: '_Val' : illegal use of type
      'void'
      NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'

      1. Patch-2010-02.patch
        5 kB
        Chuck Rolke
      2. QPID-2643-VS2010-01.patch
        4 kB
        Chuck Rolke

        Activity

        Hide
        Steve Huston added a comment -

        The additional msvc9/msvc10 directories were not accounted for in the Windows installer build script. Maybe we should have a talk about how best to handle multiple compiler versions. If it's best to move this out to a new jira, that's fine too. Just noting the issue here.

        Show
        Steve Huston added a comment - The additional msvc9/msvc10 directories were not accounted for in the Windows installer build script. Maybe we should have a talk about how best to handle multiple compiler versions. If it's best to move this out to a new jira, that's fine too. Just noting the issue here.
        Hide
        Chuck Rolke added a comment -

        Qpid now supports Visual Studio 2010. For the most part the basic C++ libraries have worked for a few months. Now the .NET Binding is in shape, too. There are a few areas that need cleanup such as VS2008 solution/projects in the C++ examples area but these can be treated as separate issues.
        Thanks for your patience and assistance while this work dragged on.

        Show
        Chuck Rolke added a comment - Qpid now supports Visual Studio 2010. For the most part the basic C++ libraries have worked for a few months. Now the .NET Binding is in shape, too. There are a few areas that need cleanup such as VS2008 solution/projects in the C++ examples area but these can be treated as separate issues. Thanks for your patience and assistance while this work dragged on.
        Hide
        Chuck Rolke added a comment -

        My recent checking, while important for VS2010, is not complete.
        I have several more items to go into the code base to support the
        /cpp directory tree.

        Thoughts?
        -Chuck

        1. Visual Studio solution (.sln) files checked in to the qpid repo.

        These are problematic in that they have an implicit Visual Studio
        version associated with them. The automated 'devenv /upgrade' gets
        tripped up for various reasons and it isn't straightforward getting
        up to VS2010 from a fresh checkout.

        I propose to change/fix the .sln files as follows:

        1A. Don't touch the \wcf area.

        T:\wcf\QpidWcf.sln
        T:\wcf\samples\Channel\WCFToWCFDirect\WCFToWCFDirect.sln
        T:\wcf\samples\Channel\WCFToWCFPubSub\WCFToWCFPubSub.sln
        T:\wcf\samples\Integration\Integration.sln
        T:\wcf\tools\QCreate\QCreate.sln

        1B. Don't touch old-examples.

        T:\cpp\examples\old_api\old-examples.sln

        1C. Separate examples\examples.sln and the VS2008 projects that go with them
        from the source directory into a compiler-specific directory.

        Existing files:

        T:\cpp\examples\examples.sln
        T:\cpp\examples\messaging\messaging_client.vcproj
        T:\cpp\examples\messaging\messaging_drain.vcproj
        T:\cpp\examples\messaging\messaging_map_receiver.vcproj
        T:\cpp\examples\messaging\messaging_map_sender.vcproj
        T:\cpp\examples\messaging\messaging_server.vcproj
        T:\cpp\examples\messaging\messaging_spout.vcproj
        T:\cpp\examples\qmf-agent\qmf_agent.vcproj
        T:\cpp\examples\qmf-console\qmf-console_console.vcproj
        T:\cpp\examples\qmf-console\qmf-console_ping.vcproj
        T:\cpp\examples\qmf-console\qmf-console_printevents.vcproj
        T:\cpp\examples\qmf-console\qmf-console_queuestats.vcproj

        Will become (See note 1):

        T:\cpp\examples\msvc90\examples.sln
        T:\cpp\examples\msvc90\messaging\messaging_client.vcproj
        T:\cpp\examples\msvc90\messaging\messaging_drain.vcproj
        T:\cpp\examples\msvc90\messaging\messaging_map_receiver.vcproj
        T:\cpp\examples\msvc90\messaging\messaging_map_sender.vcproj
        T:\cpp\examples\msvc90\messaging\messaging_server.vcproj
        T:\cpp\examples\msvc90\messaging\messaging_spout.vcproj
        T:\cpp\examples\msvc90\qmf-agent\qmf_agent.vcproj
        T:\cpp\examples\msvc90\qmf-console\qmf-console_console.vcproj
        T:\cpp\examples\msvc90\qmf-console\qmf-console_ping.vcproj
        T:\cpp\examples\msvc90\qmf-console\qmf-console_printevents.vcproj
        T:\cpp\examples\msvc90\qmf-console\qmf-console_queuestats.vcproj

        New files for Visual Studio 2010 will be added:

        T:\cpp\examples\msvc100\examples.sln
        T:\cpp\examples\msvc100\messaging\messaging_client.vcxproj
        T:\cpp\examples\msvc100\messaging\messaging_drain.vcxproj
        T:\cpp\examples\msvc100\messaging\messaging_map_receiver.vcxproj
        T:\cpp\examples\msvc100\messaging\messaging_map_sender.vcxproj
        T:\cpp\examples\msvc100\messaging\messaging_server.vcxproj
        T:\cpp\examples\msvc100\messaging\messaging_spout.vcxproj
        T:\cpp\examples\msvc100\qmf-agent\qmf_agent.vcxproj
        T:\cpp\examples\msvc100\qmf-console\qmf-console_console.vcxproj
        T:\cpp\examples\msvc100\qmf-console\qmf-console_ping.vcxproj
        T:\cpp\examples\msvc100\qmf-console\qmf-console_printevents.vcxproj
        T:\cpp\examples\msvc100\qmf-console\qmf-console_queuestats.vcxproj

        The source files for the various projects stay where they are
        and are shared by VS2008 and VS2010.
        All the build artifacts stay in the directory tree that holds the
        solution file, allowing a user to compile both variants
        in the same checkout tree.

        1D. Separate the .NET Binding .sln files (and projects) into compiler
        specific directories.

        T:\cpp\bindings\qpid\dotnet\org.apache.qpid.messaging.sessionreceiver.sln
        T:\cpp\bindings\qpid\dotnet\org.apache.qpid.messaging.sln
        T:\cpp\bindings\qpid\dotnet\winsdk_sources\winsdk_dotnet_examples.sln

        This is the same logic as for the examples solution.

        2. Repair the examples\messaging_XXX.vcproj project files to use private
        work areas for each project. For example, the drain/spout projects use:

        Win32|Debug : IntermediateDirectory="$(ConfigurationName)"
        Win32|Release : IntermediateDirectory="$(ConfigurationName)"
        x64|Debug : IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
        x64|Release : IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"

        When you build the solution on a fast multicore system it fails because
        Win32 projects step on each other.
        The proposed fix is to make all the builds look like the x64 variant.

        3. cpp/src/CMakeLists.txt

        Boost version. Boost compiles with VS2010 after 1.45 or so.
        I propose adding MSVC Boost_ADDITIONAL_VERSIONS:

        if (MSVC)

        1. Visual Studio 2010 requires boost 1.45 or better
          set (Boost_ADDITIONAL_VERSIONS "1.45" "1.45.0" "1.46" "1.46.0" "1.47" "1.47.0")
          endif (MSVC)
          find_package(Boost 1.33 REQUIRED

        To get a Visual Studio cmake to work as expected.

        4. cpp/bld-winsdk.ps1

        Modify this script:
        1. To accept the version of Visual Studio as a command line arg.
        2. Navigate the new solution directory structures to find and build the SDK.

        %%%

        Note 1: Identifying versions of Visual Studio can be confusing. Here's my scoreboard:

        Usage | Visual Studio 2008 | Visual Studio 2010
        ---------------------------------------------------------------
        MSFT internal | 9.0 | 10.0
        ---------------------------------------------------------------
        cmake generator | Visual Studio 9 2008 | Visual Studio 10
        ---------------------------------------------------------------
        VC++ toolset | v90 | v100
        ---------------------------------------------------------------
        Install dir | Microsoft Visual Studio 9.0 | Microsoft Visual Studio 10.0
        C:\Program Files| |
        ---------------------------------------------------------------
        boost bjam | msvc-9.0 | msvc-10.0
        toolset | |

        Show
        Chuck Rolke added a comment - My recent checking, while important for VS2010, is not complete. I have several more items to go into the code base to support the /cpp directory tree. Thoughts? -Chuck 1. Visual Studio solution (.sln) files checked in to the qpid repo. These are problematic in that they have an implicit Visual Studio version associated with them. The automated 'devenv /upgrade' gets tripped up for various reasons and it isn't straightforward getting up to VS2010 from a fresh checkout. I propose to change/fix the .sln files as follows: 1A. Don't touch the \wcf area. T:\wcf\QpidWcf.sln T:\wcf\samples\Channel\WCFToWCFDirect\WCFToWCFDirect.sln T:\wcf\samples\Channel\WCFToWCFPubSub\WCFToWCFPubSub.sln T:\wcf\samples\Integration\Integration.sln T:\wcf\tools\QCreate\QCreate.sln 1B. Don't touch old-examples. T:\cpp\examples\old_api\old-examples.sln 1C. Separate examples\examples.sln and the VS2008 projects that go with them from the source directory into a compiler-specific directory. Existing files: T:\cpp\examples\examples.sln T:\cpp\examples\messaging\messaging_client.vcproj T:\cpp\examples\messaging\messaging_drain.vcproj T:\cpp\examples\messaging\messaging_map_receiver.vcproj T:\cpp\examples\messaging\messaging_map_sender.vcproj T:\cpp\examples\messaging\messaging_server.vcproj T:\cpp\examples\messaging\messaging_spout.vcproj T:\cpp\examples\qmf-agent\qmf_agent.vcproj T:\cpp\examples\qmf-console\qmf-console_console.vcproj T:\cpp\examples\qmf-console\qmf-console_ping.vcproj T:\cpp\examples\qmf-console\qmf-console_printevents.vcproj T:\cpp\examples\qmf-console\qmf-console_queuestats.vcproj Will become (See note 1): T:\cpp\examples\msvc90\examples.sln T:\cpp\examples\msvc90\messaging\messaging_client.vcproj T:\cpp\examples\msvc90\messaging\messaging_drain.vcproj T:\cpp\examples\msvc90\messaging\messaging_map_receiver.vcproj T:\cpp\examples\msvc90\messaging\messaging_map_sender.vcproj T:\cpp\examples\msvc90\messaging\messaging_server.vcproj T:\cpp\examples\msvc90\messaging\messaging_spout.vcproj T:\cpp\examples\msvc90\qmf-agent\qmf_agent.vcproj T:\cpp\examples\msvc90\qmf-console\qmf-console_console.vcproj T:\cpp\examples\msvc90\qmf-console\qmf-console_ping.vcproj T:\cpp\examples\msvc90\qmf-console\qmf-console_printevents.vcproj T:\cpp\examples\msvc90\qmf-console\qmf-console_queuestats.vcproj New files for Visual Studio 2010 will be added: T:\cpp\examples\msvc100\examples.sln T:\cpp\examples\msvc100\messaging\messaging_client.vcxproj T:\cpp\examples\msvc100\messaging\messaging_drain.vcxproj T:\cpp\examples\msvc100\messaging\messaging_map_receiver.vcxproj T:\cpp\examples\msvc100\messaging\messaging_map_sender.vcxproj T:\cpp\examples\msvc100\messaging\messaging_server.vcxproj T:\cpp\examples\msvc100\messaging\messaging_spout.vcxproj T:\cpp\examples\msvc100\qmf-agent\qmf_agent.vcxproj T:\cpp\examples\msvc100\qmf-console\qmf-console_console.vcxproj T:\cpp\examples\msvc100\qmf-console\qmf-console_ping.vcxproj T:\cpp\examples\msvc100\qmf-console\qmf-console_printevents.vcxproj T:\cpp\examples\msvc100\qmf-console\qmf-console_queuestats.vcxproj The source files for the various projects stay where they are and are shared by VS2008 and VS2010. All the build artifacts stay in the directory tree that holds the solution file, allowing a user to compile both variants in the same checkout tree. 1D. Separate the .NET Binding .sln files (and projects) into compiler specific directories. T:\cpp\bindings\qpid\dotnet\org.apache.qpid.messaging.sessionreceiver.sln T:\cpp\bindings\qpid\dotnet\org.apache.qpid.messaging.sln T:\cpp\bindings\qpid\dotnet\winsdk_sources\winsdk_dotnet_examples.sln This is the same logic as for the examples solution. 2. Repair the examples\messaging_XXX.vcproj project files to use private work areas for each project. For example, the drain/spout projects use: Win32|Debug : IntermediateDirectory="$(ConfigurationName)" Win32|Release : IntermediateDirectory="$(ConfigurationName)" x64|Debug : IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)" x64|Release : IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)" When you build the solution on a fast multicore system it fails because Win32 projects step on each other. The proposed fix is to make all the builds look like the x64 variant. 3. cpp/src/CMakeLists.txt Boost version. Boost compiles with VS2010 after 1.45 or so. I propose adding MSVC Boost_ADDITIONAL_VERSIONS: if (MSVC) Visual Studio 2010 requires boost 1.45 or better set (Boost_ADDITIONAL_VERSIONS "1.45" "1.45.0" "1.46" "1.46.0" "1.47" "1.47.0") endif (MSVC) find_package(Boost 1.33 REQUIRED To get a Visual Studio cmake to work as expected. 4. cpp/bld-winsdk.ps1 Modify this script: 1. To accept the version of Visual Studio as a command line arg. 2. Navigate the new solution directory structures to find and build the SDK. %%% Note 1: Identifying versions of Visual Studio can be confusing. Here's my scoreboard: Usage | Visual Studio 2008 | Visual Studio 2010 --------------- --------------------------- --------------------- MSFT internal | 9.0 | 10.0 --------------- --------------------------- --------------------- cmake generator | Visual Studio 9 2008 | Visual Studio 10 --------------- --------------------------- --------------------- VC++ toolset | v90 | v100 --------------- --------------------------- --------------------- Install dir | Microsoft Visual Studio 9.0 | Microsoft Visual Studio 10.0 C:\Program Files| | --------------- --------------------------- --------------------- boost bjam | msvc-9.0 | msvc-10.0 toolset | |
        Hide
        Chuck Rolke added a comment -

        The attached patch is under review at https://reviews.apache.org/r/1291/ and is a general solution for VS2010, x64 and x86.

        Show
        Chuck Rolke added a comment - The attached patch is under review at https://reviews.apache.org/r/1291/ and is a general solution for VS2010, x64 and x86.
        Hide
        Steve Huston added a comment -

        See this article for info on setting _WIN32_WINNT: http://msdn.microsoft.com/en-us/library/aa383745%28v=vs.85%29.aspx

        Setting it to 0x0501 targets Windows XP - since msclfs requires Vista or Server 2008 setting it to 0x0501 prevents use of CLFS.

        Show
        Steve Huston added a comment - See this article for info on setting _WIN32_WINNT: http://msdn.microsoft.com/en-us/library/aa383745%28v=vs.85%29.aspx Setting it to 0x0501 targets Windows XP - since msclfs requires Vista or Server 2008 setting it to 0x0501 prevents use of CLFS.
        Hide
        Chuck Rolke added a comment -

        The attached patch file got qpid trunk to compile in VS2010. Thanks to Andrew Stitcher for helping this effort. Highlights are:

        1. Modify shell script to force MSVC10 as CMake generator.

        2. The List.h patch previous in this jira.

        3. Add a qualifier for int8_t.

        4. CMake changes for MSVC10

        5. Sprinkle explicit boost:: to disambiguate between boost and std.

        In addition, we had to remove the "#define _WIN32_WINNT 0x0501" for project msclfs_store. This removal is not effected by the patch. If anyone has a comment on what is a good strategy for _WIN32_WINNT settings across the board, please speak up.

        Regards,
        Chuck

        Show
        Chuck Rolke added a comment - The attached patch file got qpid trunk to compile in VS2010. Thanks to Andrew Stitcher for helping this effort. Highlights are: 1. Modify shell script to force MSVC10 as CMake generator. 2. The List.h patch previous in this jira. 3. Add a qualifier for int8_t. 4. CMake changes for MSVC10 5. Sprinkle explicit boost:: to disambiguate between boost and std. In addition, we had to remove the "#define _WIN32_WINNT 0x0501" for project msclfs_store. This removal is not effected by the patch. If anyone has a comment on what is a good strategy for _WIN32_WINNT settings across the board, please speak up. Regards, Chuck
        Hide
        Steve Huston added a comment -

        Pushed this out to 0.9 development; no time to address this for 0.8.

        Show
        Steve Huston added a comment - Pushed this out to 0.9 development; no time to address this for 0.8.
        Hide
        Jinius added a comment -

        The way to fix :

        add one line

        typedef ValuePtr value_type;

        in include/qpid/framing/List.h after line : 42.

        this bug is cause by the vs2010's stl implementation need value_type for stl contaniner.

        Show
        Jinius added a comment - The way to fix : add one line typedef ValuePtr value_type; in include/qpid/framing/List.h after line : 42. this bug is cause by the vs2010's stl implementation need value_type for stl contaniner.

          People

          • Assignee:
            Chuck Rolke
            Reporter:
            Jinius
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development