C++ - Compiling for windows XP SP1 using Visual Studio 2013 - c++

I have a project written in Visual Studio 2013.
We need to compile it somehow to work in Windows XP SP1
What do you suggest?
It's possible (but not preferable) to migrate it to VS2012.
The project works with statically linking with the CRT. We prefer to leave it that way.

Related

Which XP version does Visual Studio 2012 supports [As Target OS]

Which version of windows XP does Visual Studio 2012 supports.
[Edit: Which version does VS12 supports compiling to]
I found this article:
http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
That states that it supports XP SP3. But I didn't find any information for VS12 update 4.
Also, If the code I compile using VS12 doesn't crush on XP SP2 and seems to work.
Is it safe to use it? why not?
Thanks
It's correct, Visual Studio 2012 can compile binaries compatible with Windows XP SP3.
You need to install the Platform Toolset v110_xp and select it in the general configuration properties of your project.
If "safe" means that it works the answere is yes. We have 12.000 installations of our software compiled with Visual Studio 2012 (and recently Visual Studio 2013) perfectly working on Windows XP SP3.
The only big problem is run time debugging: you can't install Visual Studio 2012 on Windows XP so it could be a problem to find bugs that accidentally happens only on Windows XP.

Is it possible to have VS2010 and VS2012 projects concurrently on the same source code

I have a VS2010 library project that I would like to use in a new app in VS2012. Of course when I open VS2012 it wants to update the library project. Is there any way of having two projects - one for VS2010 and one for VS2012?
We have a large product portfolio and not all apps will move to VS2012 at the same time.
Generally, as long as you're running VS2010 SP1, everything will work appropriately opening the project with both versions of VS.
For C++ compatibility specifically:
You can use Visual Studio 2012 to open a C++ project that was created in Visual Studio 2010 SP1. If you want to use the Visual Studio 2012 build environment to build a project that was created in Visual Studio 2010 SP1, you must have both versions of Visual Studio installed on the same computer.
The full list of compatibility information can be found on msdn

How to correctly install platform toolsets

I know there are tons of other threads about it, but I couldn't find any which could help me.
So I've got VS2013 Ultimate installed. I've got an old project which works with only VS2008SP1. On other compilers it has compatibility issues which I don't want to bother with. So I would like to try to compile it from 2013 with 2008 tools, so I hope I can compile it without uninstalling my current VS2013.
So, if I install VS2008, will this overwrite my current 2013 or just getting added as a toolset?
If I use 2008 toolset, will this work the same way as I had a VS2008?
Do I have to do something else to make it work?
And just a secondary question which is not related to may current question at all:
If I compile a lib with VS2013, can I use this lib in my VS2008 Project, or do I have to compile the lib with VS2008 too?
Thank you for your answers!
Microsoft doesn't recommend installing VS 2008 if you already have VS 2013 installed. In general they say:
We recommend that you install Visual Studio versions in the order in
which they were released. For example, install Visual Studio 2012
before you install Visual Studio 2013.
http://msdn.microsoft.com/en-us/library/ms246609.aspx
So, to answer your question: you probably should uninstall VS 2013, but you can install it again after installing VS 2008. Before doing that though it might be a good idea to clean the register as well as file leftovers from VS 2013 to avoid compatibility problems.
And yes, you can use 2008 compiler in 2013 version. There are a plenty of SO thread about it, e.g. :
Use Visual Studio 2012 and compile with older platform toolset?
How can I use Visual Studio 2010 with the Visual C++ 2008 compiler?
If I compile a lib with VS2013, can I use this lib in my VS2008
Project, or do I have to compile the lib with VS2008 too?
You have to compile this lib in VS 2008, if you want to use it with VS 2008.

Compile in Visual Studio 2013 for Visual Studio 2010 Redistributables

I have installed MS VS Express 2013 on my office computer, and compiled a DLL with it. Now when my colleague is trying to use it, she gets an error about a missing MSVCR120.DLL. We have found MSVCR100.DLL on her PC. I know that we can get MSVCR120.DLL from Microsoft. However
it will probably require admin rights, and only I have them in our team. I wonder if I can ask VS 2013 to compile the DLL so that it uses older version of redistributables? Or is installing the previous version of VS the only solution?
I found the solution — here: https://stackoverflow.com/a/1073772/674976. The distributable DLL can be statically linked to my DLL, thus removing the dependence. This is done in VS 2013 in Project Properties (Alt + F7) > Configuration Properties > C/C++ > Code Generation > Runtime Library, which should be set to Multi-threaded (/MT) from the default Multi-threaded DLL (/MD).
However, I wonder if by doing so I am actually still using redistributable DLLs of two versions and thus risk mixing the heaps and potentially causing memory allocation problems.
If someone suggests a better solution or a clear explanation why I should simply use Visual Studio 2010, I'll be happy to accept it is an answer.
Visual Studio 2013 can build Visual Studio 2010 C++ projects. To do this, you need to also have Visual Studio 2010 installed, because VS2013 will actually call the VS2010 C++ compiler.
What I have done to accomplish this is to create the solution and all the projects in Visual Studio 2010 and make sure that they build and run correctly. Then open them in Visual Studio 2013 and make sure to NOT upgrade the projects to VS2013.
Now you can use the latest tool and still build the VS2010 dlls that you need.

Compiling in Visual C++ 2005

I wrote a C++ DLL and it has been compiled. It requires Visual C++ 2010. How can I compile it for Visual C++ 2005, and will it work for Windows XP, Windows Vista, Windows 7?
My DLL uses detours 1.5 and windows sockets. I use Visual Studio 2010.
I guess you need to install Visual C++ 2005 on the same machine, and read this article:
http://weblogs.asp.net/israelio/archive/2009/10/20/enable-vs-2010-multi-targeting-also-for-vs2005-c.aspx
(I have used multi targeting of VS 2010 only for the VS 2008 tool chain, but with the patch above it should work in a similar manner).