If you want to port an existing 32-bit application for the x64 platform (especially since 32-bit processors will soon be history), or if you want to target x64 for a new application, the first step in building for x64 is setting up your solution. In this post I will explain what are the steps in configuring x64 as target platform for your projects. Of course you must have the 64-bit compiler and tools installed to make this possible.
Here is an example of a solution with two VC++ project (a Win32 DLL and a console application).
The VC++ wizards add only Win32 (i.e. x86) as target platform for your projects and for your solution (I believe this will change in the future). You can see this by expanding the platforms combo.
If you open the Configuration Manager window for the solution you can see the available solution platforms, and for each project, the available project platforms (these might not be the same).
The configuration manager allows you to set for each pair of solution configuration and solution platform the platform for each individual project. So in theory you can configure for Debug with Win32 at solution level to have, in my demo solution, DemoProject targeting Win32 and DemoLibrary targeting x64. Of course, in practice you probably want to have all projects targeting Win32 in this case, and for the pair Debug with x64 at solution level, have all projects targeting the x64 platform.
To make this platform available for the solution, expand the Active solution platform combo and select
Then make sure you check the Create new project platforms checkbox. In this case the x64 platform will also be defined for every project included in the solution.
After you do this, the x64 platform will be available in the configuration manager for the solution and the projects, so that you can configure the relationships.
Also, the solution platforms combo from the toolbar now displays both Win32 and x64.
But now let’s say you add a new project to the solution. Let’s call this DemoLibrary2.
Since the project was added after defining x64 as a target for the solution and all the projects, the x64 platform won’t be defined for this project (remember, by default, the VC++ wizards don’t add x64 as target platform). You can see this in the configuration manager, where only Win32 is available for the new project.
To define the x64 target for the new project, use the project platform combo and select
After that, the x64 platform will be available for the new project too, and you can make the appropriate configurations in the Configuration Manager window.
And with that you’re done. All you have to do now is configure the settings for each project, for each configuration and platform.