locked
Port Win32 applicatin to VS 2013 RRS feed

  • Question

  • Hello,

    A Win32 project is created in VS 2010 and now I need to update the toolset of the project to use VS 2013. I have VS 2013 professional and able to update the platform toolset to use "Visual Studio 2013 (v120)".

    The application works well on Win 7 onwards. Tried with Windows XP and has got "(exe path) is not a valid Win32 application." error. So after changing the platform toolset to use "Visual Studio 2013 - Windows XP (v120_xp)" application works well in XP too.

    My application uses third party libraries which are updated to use platform toolset to use "Visual Studio 2013 (v120)".

    My question is

    "Do I need to change the platform toolset for third party libraries to use 'Visual Studio 2013 - Windows XP (v120_xp)' " during compilation?

    Please suggest on the same.

    Thanks in advance.

    Tuesday, July 1, 2014 1:24 PM

Answers

  • Hi,

    If you want to run your application on XP, you can set the platform toolset to "Windows XP(v120_xp)". If you want the executable to run on XP then using the v120_xp toolset is a hard requirement.

    We can link a v120_xp lib into a v_120 exe/dll without problem.

    If you don't change the platform toolset to v120_xp then it doesn't matter.

    The only setting that really matters is the linker's /subsystem option.  Starting with VS2012, the toolset sets this so that your executable contains 6.0 as the required subsystem.  The Windows generation that started with Vista.  And using v120_xp changes this setting, using the legacy value of 4.0.  The generation that started with NT 4.0.  XP is generation 5.0, it will refuse to run a program that has the subsystem set to 6.0

    Please refer to http://stackoverflow.com/questions/22042100/can-i-link-a-static-library-built-with-the-v120-xp-toolset-into-an-exe-dll-built

    Also, there are quite a few things you just can't do with the XP-dedicated toolset. It makes use of old headers and libraries, and so apps built with it just can't call a lot of newer APIs and use some fancy newer tools. More information, please refer to http://blogs.msdn.com/b/chuckw/archive/2012/11/26/visual-studio-2012-update-1.aspx

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by savana_007 Wednesday, July 2, 2014 7:06 AM
    Wednesday, July 2, 2014 2:49 AM

All replies

  • Hi,

    If you want to run your application on XP, you can set the platform toolset to "Windows XP(v120_xp)". If you want the executable to run on XP then using the v120_xp toolset is a hard requirement.

    We can link a v120_xp lib into a v_120 exe/dll without problem.

    If you don't change the platform toolset to v120_xp then it doesn't matter.

    The only setting that really matters is the linker's /subsystem option.  Starting with VS2012, the toolset sets this so that your executable contains 6.0 as the required subsystem.  The Windows generation that started with Vista.  And using v120_xp changes this setting, using the legacy value of 4.0.  The generation that started with NT 4.0.  XP is generation 5.0, it will refuse to run a program that has the subsystem set to 6.0

    Please refer to http://stackoverflow.com/questions/22042100/can-i-link-a-static-library-built-with-the-v120-xp-toolset-into-an-exe-dll-built

    Also, there are quite a few things you just can't do with the XP-dedicated toolset. It makes use of old headers and libraries, and so apps built with it just can't call a lot of newer APIs and use some fancy newer tools. More information, please refer to http://blogs.msdn.com/b/chuckw/archive/2012/11/26/visual-studio-2012-update-1.aspx

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by savana_007 Wednesday, July 2, 2014 7:06 AM
    Wednesday, July 2, 2014 2:49 AM
  • Hello Anna,

    Thanks for the replay.

    Can we link a v_120 lib into a v120_xp exe/dll without any problem. Does this cause any unexpected behavior?

    Thanks in advance.

    Wednesday, July 2, 2014 7:06 AM