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

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).

Related

Microsoft Visual C++ runtime versions? Do I need to keep 'em all?

I've been looking around and I'm not sure I see a clear answer to this so I'm sorry if this has been asked before; my "Google-Fu" is failing me.
We are developing software against .NET Framework but historically we have had to include a number of 3rd party components. Also, historically, these tended to come with various dependencies on Microsoft Visual Studio C++ runtime versions. This has led to us distributing as part of our initial installation process:
Microsoft Visual Studio C++ 2005 Redistributable (SP1) - build 8.0.61001
Microsoft Visual Studio C++ 2008 Redistributable - build 9.0.30729.6161
Microsoft Visual Studio C++ 2010 Redistributable - build 10.0.40129
Microsoft Visual Studio C++ 2012 Redistributable - build 11.0.61030
But as the years have gone on many of the 3rd party components we used have been replaced with newer and better ones, and we include them to our Projects through NuGet. And I'm finding that as I install our software on systems without installing the above first most of our applications are working perfectly normally without errors. So I'm starting to think a lot of the above are no longer necessary.
Ideally I would just like to chuck 'em all. Relieve the pressure on our support staff to install all these components as well as our software when setting up machines for first use.
It would be great if I could just tell them "look, just install VC++ redistributable version xyz and anything that needs one of the above four builds will work just fine"
I see many resources online claiming that, for example, the 2017 redistributable replaces the 2015 one, and so on but does that backward compatibility go all the way back to the 2005 SP1 version?
My second question is a bit more generic and I don't really expect many answers to that one but.
are there any well known 3rd party developer tools that you know are using one of the four Redistributables mentioned in my list above? For example, we use Crystal Reports runtime 13.0.17 - oh how I wish we could dump that and move on .... And one of our support staff has already identified that that sometimes won't install if the 2005 SP1 runtime is missing. Trying to find out such info from online resources is like looking for a needle in a haystack....
the 2017 redistributable replaces the 2015 one, and so on
Yes, for certain values of "and so on" ;-) The 2015, 2017 and 2019 redistributables are binary compatible with the most recent release thereof. Quoting Microsoft from C++ binary compatibility between Visual Studio 2015, 2017, and 2019:
The runtime libraries and apps compiled by any of these versions of the compiler [2015, 2017, 2019] are binary-compatible. It's reflected in the C++ toolset major number, which is 14 for all three versions. [...] Say you have third-party libraries built by Visual Studio 2015. You can still use them in an application built by Visual Studio 2017 or 2019. There's no need to recompile with a matching toolset. The latest version of the Microsoft Visual C++ Redistributable package (the Redistributable) works for all of them.
does that backward compatibility go all the way back to the 2005 SP1 version?
No. Quoting again from the same page:
The Microsoft C++ (MSVC) compiler toolsets in Visual Studio 2013 and earlier don't guarantee binary compatibility across versions. You can't link object files, static libraries, dynamic libraries, and executables built by different versions. The ABIs, object formats, and runtime libraries are incompatible.
To make things even worse, VS 2005 and 2008 did not have one single set of redistributables, but instead several different versions that were installed in SxS (side by side) mode. From Side-by-side assembly:
In side-by-side, Windows stores multiple versions of a DLL in the WinSxS subdirectory of the Windows directory, and loads them on demand. This reduces dependency problems for applications that include a side-by-side manifest. [...] Microsoft Visual C++ 2005 and 2008 employ SxS with all C runtime libraries.
are there any well known 3rd party developer tools that you know are using one of the four Redistributables mentioned in my list above?
This is way too wide for any useful answer. You'll have to (a) identify which tools/components/etc you are using, and (b) which are the dependencies of each, including (though not limited to) the C/C++ runtimes.

InstallShield limited edition in visual studio 2012 on windows 10 gives BSOD

I'm working with installshield 2013 limited edition in visual studio 2012. This used to work fine on windows 8.1. After upgrading to windows 10 installshield produces a BSOD: registry_filter_driver_exception; ISRegFlt64.sys problem.
This is a known problem for Flexera but they don't seem to offer an upgrade.
Or am I missing something?
The fix is present in InstallShield 2015, including the 2015 Limited Edition. If you can't use that because of editions of Visual Studio, you should be able to just take the updated driver and replace it per (tweaked) instructions on the community (except for the bug fix, the driver is shared and hasn't changed lately):
... copy ISRegFlt.sys (ISRegFlt64.sys on 64-bit machines) from \Program Files (x86)\InstallShield\2015\System to the System folders of any other recent versions of [InstallShield] on the machine.

Targetting Windows xp from visual studio 2015 enterprise update 1

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 "-"

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.

Is it possible to use the VC++ 6 compiler in Visual Studio 2012?

I am using Visual Studio 2012 to develop my projects, and I also have installed Visual Studio 2010 - which gives me the option to use the VC++10 compiler in Visual Studio 2012 (project properties), but I also have installed Visual C++ 6 and somehow the option to use the VC++6 compiler is not present in Visual Studio 2012, how do I add this option (manually)?
The answer is definitely maybe. It seems quite possible, but I could not get a copy of VC 6 so I was unable to verify it. What I was able to do was to get VS 2012 to use VC 7 (VS 2002) to compile a project.
Update: The answer is definitely yes. The OP indicates in the comments that he was able to get VC 6 working by using this solution.
Configuration
The way I did this was to install the following (in order of install):
Windows 7, SP1, 32 Bit
I chose Windows 7 because it is the earliest version of Windows that will support VS 2012. I used a 32 Bit version because VS 2002 (VC7) would not install on an x64 machine.
Visual Studio 2002, SP1
As I mentioned, I could not get VC6. It was no where to be found on Microsoft's site. Bruce's comment under this question provides this helpful insight:
Visual C++ 6.0 isn't available (including via MSDN) from Microsoft because it included the Microsoft JVM. See this link for details. – BruceCran
After seeing the above, I figured that installing VS 2002 (VC 7) was the next best thing.
Obviously, this is where you would install VC 6, if you have a copy1.
1I should note, for anyone that is interested, that VC 6 is available on Ebay. If I were being paid in actual currency instead of points I would have gone the extra mile and gotten a copy of VC 6 to test.
Visual Studio 2010, SP1
The only reason for this is that it is a requirement for Daffodil. More on Daffodil below.
Visual Studio 2012, Update 2
This is a requirement from the original question.
Daffodil
This is a set of configuration files that allows VS 2010 and VS 2012 to target older VC compilers.
Currently, these are the supported VC compiler versions:
VC 8 (Visual Studio 2005)
VC 7.1 (Visual Studio 2003)
VC 7 (Visual Studio 2002)
VC 6 (Visual Studio 6)
I should note that Daffodil does not officially support VS 2012 as an IDE, but it does seem to work. From the Daffodil site:
Daffodil works fine in VS 2012 and later versions2 as long as VS 2010 is also installed.
2 There appears to be a debugging problem when using VS 2013 and VS 2015, as noted here:
Debugging information does not match, when using v60 platform toolset inside Visual Studio 2013
Testing
To test the above I created a new C++ Win 32 console project in Visual Studio 2012. I then removed all header and cpp files from the project - these have things that are VS 2012 specific, so were not needed. I then added a simple "hello world" file that I could use to test:
#include <iostream.h>
void main()
{
cout << "Hello World!" << endl;
}
Using the project as is (targeting VS 2012), I tried to build it and it failed.
Next, I right-clicked the project and selected properties. I selected Configuration Properties on the left side of the dialog, and then under Platform Toolset, on the right, I selected v70. You will note that there is also an option for v60:
I then saved the change to the project and did a build. It built an exe successfully. Just to verify that VC 7 was being used, I launched Process Monitor during the compile:
As you can see cl.exe, the compiler, is being called from the VC 7 directory.
Final Thoughts
The original question involves compiling an existing VC 6 project. Just a couple of notes on this.
My guess is that for retargeting to work, that you will have to create a new empty project in VS 2012, and then add in all of the existing source files. The reason for doing this is that obviously the project format is different between the two versions of Visual Studio.
As I mentioned, I tested using VC 7 instead of 6. I suppose the last step is for the OP to try all of this using VC 6. Hopefully it all works.
Links
Daffodil at CodePlex
C++ Native Multi-Targeting for VS 2010 at the C++ Team Blog
VS Android - Configuration for targeting Android using VS 2010
VS-Tool - Configurations for targeting various frameworks: Clang, EmScripten, MinGW, NACL, Python

Resources