6

What's the difference between "visual studio x64 win64 command prompt", "visual studio x64 cross tools command prompt", and "visual studio command prompt" appearing in the Visual Studio 2010 menu in the Start button?

For the most useful answer, let us be clear about my ignorance level: I'm closer to noob than guru at anything Microsoft or IDEs in general. Long time expert at Linux, editing source in a plain text editor, handmade Makefiles, etc.

I'm sure the differences are simple, perhaps "obvious" to anyone with modest experience at VS2010.

DarenW
  • 16,549
  • 7
  • 63
  • 102

2 Answers2

4

The different batch files adjust PATH, LIB, INCLUDE and LIBPATH so that you can run cl.exe and other build tools easily.

IronMensan
  • 6,761
  • 1
  • 26
  • 35
  • 8
    After running the x64 version on a 64 bit machine, you can build 64-bit object files and link against 64-bit libraries without specifying any absolute paths because they are all in the environment variables. Cross tools is for building 64-bit binaries on a 32-bit machine and the last one is for 32-bit builds. – IronMensan Jul 27 '12 at 21:42
  • 4
    That should be the answer, not a comment. – DarenW Jul 27 '12 at 22:40
1

This answer focuses mostly on VS2013. Microsoft's documentation http://msdn.microsoft.com/en-us/library/ms229859%28v=vs.110%29.aspx states:

Starting with Visual Studio 2010, you may see multiple command prompts, depending on the version of Visual Studio and any additional SDKs you've installed. For example, 64-bit versions of Visual Studio provide both 32-bit and 64-bit command prompts. (The 32-bit and 64-bit versions of most tools are identical; however, a few tools make changes specific to 32-bit and 64-bit environments.)

It adds, rather unhelpfully:

Check the documentation for the individual tools to determine which version of the command prompt you should use.

The page http://msdn.microsoft.com/en-us/library/jj153218.aspx lists five such command prompts:

  • Developer Command Prompt for VS2013
  • VS2013 ARM Cross Tools Command Prompt
  • VS2013 x64 Cross Tools Command Prompt
  • VS2013 x64 Native Tools Command Prompt
  • VS2013 x86 Native Tools Command Prompt

On my machine, only the 1st, 3rd, and 5th of these are present, and they launch, respectively:

%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"" %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86_amd64 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86

To check the environment variables, running the set command for first and "x86 Native" shells gives identical results on my machine. And mmohamad's answer tp Difference between VsDevCmd.bat & vcvarsall.bat in VS2012 agrees with this.

But "x64 Cross" is different: the difference is (excluding Path and LIBPATH for brevity):

 + CommandPromptType=Cross
 + FrameworkDIR64=C:\WINDOWS\Microsoft.NET\Framework64
 + FrameworkVersion64=v4.0.30319
 + Platform=x64
 - LIB=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86;
 + LIB=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\amd64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;
Community
  • 1
  • 1
Joseph Quinsey
  • 9,553
  • 10
  • 54
  • 77