How To Compile64-bit Code For Windows X 64

Main Menu

edit SideBar

How To Compile64-bit Code For Windows X 64

How to Compile 64-bit Code for Windows x64

History

  • 7-17-2005: Updated VS6 batch files; added links.
  • 5-8-2005: Updated VS6 instructions; added links.
  • 5-3-2005: VS6 procedure added.
  • 5-2-2005: links & material only.
  • 9-25-2006: added replacement setenv.bat.
  • 10-3-2007: migrated to wiki.

Things to Download & Install Before Continuing...

Visual Studio 6 Procedure

  1. For this procedure I use the "64-bit Retail" approach.
  2. Save the batch files to launch VS6 for your appropriate build target. You may need to edit the paths in them; they assume that VS6 is installed to the default location.
  3. If you use the Windows DDK, replace "setenv.bat" with this file to keep all other includes & libraries active.
  4. Launch VS6 from one of the 64-bit batch files.
  5. Open the project you wish to port.
  6. "Build" -> "Configurations" -> "Add Project Configuration" -> name it "Retail64" & copy from "Release" settings.
  7. "Active Configuration" -> "Retail64"
  8. Set the following in "Project Settings"...
  • "General" tab -> change the Intermediate & Output directory names to "Retail64" if you'd like: they default to something odd. If your project is going to be 64-bit only, set them to "Release."
  • "C/C++" tab -> "Debug Info" = "Program Database"
  • "C/C++" tab -> remove "/GZ" from "Project Options"; replace "/GX" with "/EHsc"; add "/Wp64"; add "/GA" if you're making a Windows application; change "/Gi" to "/Gm" if present; add /GL for link-optimized-code. These changes remove runtime checking, support error-checking, and test for 64-bit compatability; adding "GA" optimizes the program for Windows; changing "Gi" to "Gm" invokes a "minimal rebuild."
  • "Link" tab -> change "/machine:I386" to "/machine:IX86" & add "/machine:AMD64" to "Project Options." This enables AMD64 binary compilation. If you used the "GL" switch earler, add "/LTCG" to "Project Options" to complete the support for link-optimized code.
  • "Link" tab -> add "bufferoverflowU.lib" to "Object/Library modules." This enables security checking mandated by default in Microsoft's compiler; see "security cookie" error references for information.

You're ready to compile 64-bit code. To verify your application is 64-bit, open Task Manager & look at "Processes:" if your EXE doesn't have a "*32" next to it, its 64-bit.

References

Additional Links

Other

Microsoft is a registered trademark of Microsoft Corporation, and is in no way affiliated with this website.

Recent Changes (All) | Edit SideBar Page last modified on October 03, 2007, at 07:39 PM Edit Page | Page History
Powered by PmWiki