Walking Corpse
Walking Corpse

Reputation: 73

Visual Studio 2008 for Windows 7 64 bit (for creating 64 bit binaries)

I know the 32 bit visual studio will install on Windows 7 64 bit machine, but I suppose it can only be used to create 32 bit dlls. Is there a separate visual studio installer available to install 64 bit Visual studio that can be used for creating 64 bit dlls?

Edit: Sorry for not visiting my own question for so long. I'm building the solution using devenv command: devenv mysolution.sln /build "RELEASE|WIN64"

It skipped building all projects. So I opened the solution in Visual Studio, and in the build Configuration manager, I set

Active Solution Configuration: Release Active Solution Platform: win64

But in the Project contexts (check the project configurations to build or deploy):

Configuration: Release Platform: Win32 alone is available in this dropdown, not win64.

What do I need to do?

Upvotes: 0

Views: 28582

Answers (2)

Hans Passant
Hans Passant

Reputation: 941635

VS2008 comes with three compilers. You'll find them back in the vc\bin, vc\bin\x86_amd64 and vc\bin\amd64 subdirectories of the VS install directory. Respectively a 32-bit compiler to generate x86 code, a 32-bit compiler to generate x64 code and a 64-bit compiler to generate x64 code. The latter will only work on a 64-bit operating system and is not used by default. Which you can change with Tools + Options, Projects and Solutions, VC++ Directories, Platform = x64.

Beware that the 64-bit compilers are not installed by default. You would have had to select the custom setup when you originally installed VS2008. Re-run setup and reapply SP1 to fix.

Upvotes: 4

ewall
ewall

Reputation: 28110

You are correct in noting that Visual Studio (even v2010) is a 32-bit app, and will default to running the 32-bit build environment, which in most cases is good for creating EXEs that work well on both x86 and x64. There are a few x64 VS components that you can (and should) choose during the installation.

The build tools are able to cross-compile for the 3 major platforms, and you can pick which platform you're targeting. If you want to be sure you're using the x64 compiler, then you want to run it from the command-line with DEVENV.

Read this article for some "gotchas" on cross-compiling for x64.

The build tools are part of the Windows SDK, and the web installer is platform-aware and will install 64-bit capable build environment. (Or if you're downloading the ISO image for installation, be sure to get the x64 one--see the SDK Release Notes.) After installation, you should see icons in the Start Menu group which launch the command prompt with x86, x64 and ia64 options set.

(Lastly, note that there a known issue only if you have installed the SDK before VS 2008 RTM, but that is fixable following the directions in the KB article.)

Upvotes: 5

Related Questions