How to compile a 64-bit application using Visual C++ 2010 Express?

C++64 BitVisual Studio-Express

C++ Problem Overview


Is there a simple way to compile a 64 bit app with the 32-bit edition of Visual C++ 2010 Express? What configurations, if any, are necessary?

C++ Solutions


Solution 1 - C++

Here are step by step instructions:

  1. Download and install the Windows Software Development Kit version 7.1. Visual C++ 2010 Express does not include a 64 bit compiler, but the SDK does. A link to the SDK: http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx
  2. Change your project configuration. Go to Properties of your project. On the top of the dialog box there will be a "Configuration" drop-down menu. Make sure that selects "All Configurations." There will also be a "Platform" drop-down that will read "Win32." Finally on the right there is a "Configuration Manager" button - press it. In the dialog that comes up, find your project, hit the Platform drop-down, select New, then select x64. Now change the "Active solution platform" drop-down menu to "x64." When you return to the Properties dialog box, the "Platform" drop-down should now read "x64."
  3. Finally, change your toolset. In the Properties menu of your project, under Configuration Properties | General, change Platform Toolset from "v100" to "Windows7.1SDK".

These steps have worked for me, anyway. Some more details on step 2 can be found in a reference from Microsoft that a previous poster mentioned: http://msdn.microsoft.com/en-us/library/9yb4317s.aspx.

Solution 2 - C++

> 64-bit tools are not available on > Visual C++ Express by default. To > enable 64-bit tools on Visual C++ > Express, install the Windows Software > Development Kit (SDK) in addition to > Visual C++ Express. Otherwise, an > error occurs when you attempt to > configure a project to target a 64-bit > platform using Visual C++ Express.

How to: Configure Visual C++ Projects to Target 64-Bit Platforms

Ref: http://msdn.microsoft.com/en-us/library/9yb4317s.aspx

Solution 3 - C++

And make sure you download the Windows7.1 SDK, not just the Windows 7 one. That caused me a lot of head pounding.

Solution 4 - C++

I found an important step to add to this - after you've installed the SDK, go to your project properties and change Configuration Properties->General->Platform Toolset from v100 or whatever it is to Windows7.1SDK. This changes $(WindowsSdkDir) to the proper place and seemed to solve some other difficulties I was encountering as well.

Solution 5 - C++

Note that Visual C++ compilers are removed when you upgrade Visual Studio 2010 Professional or Visual Studio 2010 Express to Visual Studio 2010 SP1 if Windows SDK v7.1 is installed.

For instructions on resolving this, see KB2519277 on the Microsoft Support site.

Solution 6 - C++

Download the Windows SDK and then go to View->Properties->Configuration Manager->Active Solution Platform->New->x64.

Solution 7 - C++

Programming in a 64-bit environment is quite different than 32-bit environment. Code generated has totally different assembly constitution in 32 & 64-bit code, even the protocols of communicating with functions change. So you can't generate 64-bit code using 32-bit compiler.

You might want to see an article on Microsoft's web site about targeting a 64-bit target but using a 32-bit development machine.

Solution 8 - C++

As what Jakob said: windows sdk 7.1 cannot be installed if MS VC++ x64 and x86 runtimes and redisrtibutables of version 10.0.40219 are present. after removing them win sdk install is okay, VS C++ SP1 can be installed fine again.

Kind regards

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNathan OsmanView Question on Stackoverflow
Solution 1 - C++MattView Answer on Stackoverflow
Solution 2 - C++YOUView Answer on Stackoverflow
Solution 3 - C++Jamie FristromView Answer on Stackoverflow
Solution 4 - C++MattView Answer on Stackoverflow
Solution 5 - C++user634180View Answer on Stackoverflow
Solution 6 - C++duduongView Answer on Stackoverflow
Solution 7 - C++perilbrainView Answer on Stackoverflow
Solution 8 - C++Hadrien HuvelleView Answer on Stackoverflow