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

8

130

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?

Clime answered 8/12, 2009 at 6:45 Comment(0)
D
182

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.

Destine answered 20/12, 2011 at 22:0 Comment(7)
Congratulations - your answer just earned you 275 rep. Thanks for an awesome answer!Clime
I have Windows XP but the SDK is for Windows 7. Will this still work?Internationale
@0x499602D2: I don't know. I would hope that if the Visual C++ and SDK versions were the same, it would. Did you try it?Destine
Fails here: The Platform drop-down of my project has no "New" item to select.Milkfish
This worked for me only after installing patches 3 and 4 mentioned here: https://mcmap.net/q/67888/-64-bit-build-on-microsoft-visual-c-express-2010Nomo
@Matt: this all works for me on WinXP 64bit. What is the reason to change Platform Toolset to Win7.1SDK?Enisle
In my case, I am at Step 3, and I did not see "Properties | General", i need to install this to have my project successfully compiled for x64 platform.Bulrush
P
49

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

Pickett answered 8/12, 2009 at 6:51 Comment(3)
is this available for VB 2010 Express?Calida
For some reason my $(WindowsSdkDir) didn't seem to work right but once I added in the absolute paths manually it worked a champ.Downtime
After following the instructions I kept getting blank property pages for the x64 platform. I had to install the compilers update here. More info at KB2519277.Hofstetter
I
14

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

Ivelisseivens answered 14/12, 2011 at 21:51 Comment(0)
D
9

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.

Destine answered 7/12, 2011 at 17:51 Comment(0)
R
5

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.

Rival answered 16/4, 2012 at 10:58 Comment(1)
This would be better served as a comment since it doesn't actually answer the question at hand.August
A
4

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

Argument answered 7/11, 2011 at 17:11 Comment(1)
what is the program to run ? I don't find any program with a "View" availableDorsoventral
S
3

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.

Straitjacket answered 21/12, 2011 at 21:7 Comment(2)
The answer given is as per the Intel DocumentationStraitjacket
Yes it is true that any dependencies will have to be (re) compiled using the 64 bit compiler as well, or the link step will fail.Downtime
E
2

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

Effieeffigy answered 6/3, 2014 at 13:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.