Targetting Windows xp from visual studio 2015 enterprise update 1 - visual-c++

I would like to know whether we can build the projects/binaries using visual studio 2015 which can run on Windows xp ? If its supported then how we can build ?

Configuring C++ 11 Programs for Windows XP
The Windows XP platform toolset that's included in Visual Studio is a version of the Windows 7 SDK that was included in Visual Studio 2010, but it uses the current C++ compiler. It also configures project properties to appropriate default values—for example, the specification of a compatible linker for down-level targeting. Only Windows desktop apps that are created by using the Windows XP platform toolset run on Windows XP and Windows Server 2003, but those apps can also run on more recent operating systems—for example, Windows Vista, Windows 7, Windows Server 2008, Windows 8, or Windows Server 2012.
To target Windows XP
In Solution Explorer, open the shortcut menu for your project, and then choose Properties.
In the Property Pages dialog box for the project, under Configuration Properties, General, set the Platform Toolset property to the desired Windows XP toolset. For example, choose Visual Studio 2012 – Windows XP (v110_xp) to create code that is binary compatible with the Microsoft Visual C++ 2012 Redistributable libraries.

As mentioned by dxiv Windows XP can be targeted from visual studio using the correct Platform toolset (Visual Studio 2015 - Windows XP (v140_xp)).
This is not in all cases sufficient. Because the vs compiler was extended by propper thread local storage (TLS) handling there is an additional change needed. The new TLS is not properly supported by Windows XP and therefore static objects in dll's will not be initialized. If you want to avoid this problem us the additional compiler flag /Zc:threadSafeInit- to disable this problematic feature.
If you would like to use boost, you have to build it yourself. To make it compatible with Windows XP the following options have to be added :
1) run these commands before the build with b2 (bjam)
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
SET "INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE%"
SET "PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;%PATH%"
SET "LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;%LIB%"
2) use these additional options for b2
toolset=msvc-14.0
address-model=32
define=BOOST_USE_WINAPI_VERSION=0x0501
define=_USING_V110_SDK71_
linkflags=/SUBSYSTEM:CONSOLE,5.01
cxxflags="/Zc:threadSafeInit- "
Note:
the define is _USING_V110_SDK71_ not _USING_V140_SDK71_.
the space in cxxflags="/Zc:threadSafeInit- " is intentional du to a bug in b2 which would remove the trailing "-"

Related

How to do remote debugging on WinXP for an application build using Visual Studio 2013?

I am wondering how we are suppose to use the remote debugger on a target machine with Windows XP for applications build using Visual Studio 2013.
It seems that Remote Debug Tools for Microsoft Visual Studio 2013 (and 2012) do not install on Windows XP, complaining that they need a newer Windows version. Microsoft download do not say a thing about requirements.
I guess there should be a way of doing it...
Here is the document on Visual Studio 2013 Compatibility and it does state that Remote Debugging and profiling tools are not available for the targeted platforms of XP and Vista.
Most likely the reason that the Remote Tools for Visual Studio 2012 and 2013 do not run on XP is that XP does not support .NET 4.5.
Target your app for .NET 4 so you can run it on the XP platform, and use Visual Studio 2013 to do the majority of the coding and then use Visual Studio 2010 to do the remote debugging when needed. VS 2010 and 2013 can run side by side and the project formats are compatible so you should be able to go back and forth very easily.

Targetting Windows XP from Visual Studio 2012 when using C++ DLL

I am trying to execute a C# program on Windows XP (SP3) which references a managed C++ DLL compiled with VS2012. When compiling the C++ DLL, I have set the Platform Toolset to build to Windows XP (using the v110_xp option) and set minimum required version to 5.01 in linker options, and I already installed Visual C++ 2012 Redistributable Package on the Windows XP machine. But it didn't work.
Any idea on this?
As you mentioned Platform Toolset and v110_xp option, I'd risk assuming the question is about an unmanaged C++ DLL. Anyway, try compiling your DLL with the original VS 2012 distribution (no updates) and see if it works. I dealt with a similar issue caused by VS 2012 Update 2, which is described here. You could test each of your dependency DLLs (including VC++ redistributables) with DependencyWalker, to check if any of them is using a Win32 API not implemented by Windows XP. Just do it under XP itself.

Can I use the Visual Studio 2010 remote debugger on Windows XP to debug a .Net 4.0 app from Visual Studio 2012?

Can I use the Visual Studio 2010 remote debugger on Windows XP to debug a .Net 4.0 app from Visual Studio 2012?
I am trying to, here is a screenshot of my XP machine (I have disabled the local firewall temporarily):
Here is Visual Studio 2012 (the text in the remote machine box is identical to the server name indictaed by the Visual Studio remote debugger):
When I try to debug, I get this error:
If I change the computer name to anything else, I get this error:
Is being able to debug .Net 4.0 apps remotely from Visual Studio 2012 on Windows XP wishful thinking on my part or should this work?
Just to give some background, we have some .Net 4.0 code running on Windows 7 ok, but crashing under XP. I understand that the .Net 4.5 compiler is an in place upgrade of the 4.0 compiler, and if you have a bug in .Net 4.0 which has been fixed in 4.5, your 4.0 code will compile fine because you are using the more up to date, fixed compiler, but you may get runtime issues on actual .Net 4.0 machines. I suspect this may be the case and wish to test it out.
And we have to use Visual Studio 2012, I don't make the rules!
The MSDN blog tells us (2012 Oct 8) that there is no support for remote debugging from VS 2012 to XP:
Remote Debugging
The Remote Tools for Visual Studio 2012 do not support remote debugging on an XP client. When debugging on Windows XP is required, it is recommended to use the debuggers of an older version of Visual Studio, such as Visual Studio 2010, for local or remote debugging. This is in line with the Windows Vista experience for Visual Studio 2012 RTM, which is a runtime target but not a remote debugging target.

Why last additions to VC++11 are not allowed in XP target'

I want to compile next line:
R"(The String Data \ Stuff " )"
When target is windows XP (vc110_xp), it gives me compilation error; if the VC++ target is not Windows XP, compiler accepts the syntax.
¿Why?
The November 2012 Compiler CTP is a community technology preview: it's a preview for people to use and test with, but is not intended for production use (it does not come with a "Go Live" license).
Visual Studio 2012 Update 1 is an update for Visual Studio 2012 that is intended for production use. This is the update that includes support for using Visual C++ 2012 to target Windows XP.
These are two different releases, made for two different purposes. The November 2012 Compiler CTP was released before Visual Studio 2012 Update 1 was released, and it does not include the support for Windows XP (it only updates the compiler binaries, though, so you might be able to use some MSBuild magic to use the new preview compiler with the new Windows XP support libraries; doing so is not supported, though).

Does Visual Studio 2012 include the full Windows SDK

If I've installed the Visual Studio 2012, do I need to install the Windows SDK, or are all tools / parts of the SDK included as part of the Visual Studio installation.
The visual studio 2012 installer does not contain the full Windows SDK or Visual Studio 2012 SDK. these need to be installed separately.
Depends on which version of VS 2012 you have installed. Professional version and above include the Windows 8 SDK, so unless you are planning to develop applications for Windows XP or earlier versions of the OS, there is no need to install the SDK separately - you would already have it.
However, if you have installed VS 2012 Express, I would suggest referring to on-line documentation for clarification on this issue.
See this post for more information:
http://blogs.msdn.com/b/chuckw/archive/2012/03/22/where-is-the-directx-sdk.aspx
"The DirectX SDK is now part of the Windows 8.0 SDK."
"The Windows SDK for Windows 8 (aka Windows 8.0 SDK) is included with Visual Studio 2012, and is also available as a standalone package for use with Visual Studio 2010."

Resources