Compiling 64bit with VC++ 2005 Express using PSDK

This little guide I made is to make the VC++ 2005 Express compile 64bit using the latest PSDK (altough I'm not sure how good it works)

I'll assume you already have VC++ 2005 Express and the PSDK installed, and activated the Win32 application building in VC++ and running 64bit Windows (well it maybe works in 32bit windows too but the exe will not run in that enviroment)

1) Start -> All Programs -> Microsoft Platform SDK for Windows Server 2003 SP1 -> Windows XP 64-bit Build Environment -> Set Windows XP x64 Build Environment (Debug/Retail) <- doesn't mather which one at this moment
2) start the VC++ 2005 Express IDE run the VCExpress.exe file with the /USEENV swich: [your install dir of VC++ 2005 Express]\Common7\IDE\VCExpress.exe /USEENV This will clear out all default bin/lib/include path and add only those that the 'Set Windows XP x64 Build Environment (Debug/Retail)' batch file sets for you.
3) Open your application or create a new one.
4) Edit the properties for the application ( Project -> Properties ) and change this settings to this values.
C/C++ -> General -> Debug Information Format : Program Database (/Zi)
C/C++ -> Code Generation -> Basic Runtime Checks : Default
Linker -> Advanced -> Target Machine : not set
Linker -> Command Line -> Additional Options : /MACHINE:AMD64
now it should be able to compile for 64bit (I think I havn't forgotten anything)
altough I got this error:
error PRJ0002 : Error result 128 returned from 'C:\Program Files\Microsoft Platform SDK\Bin\mt.exe'.
but solved it by copy the mt.exe that comes with the VC++ 2005 Express install to the PSDK/Bin dir, thus overwriting the PSDK/bin/mt.exe.
Another thing I almost forgot. you maybe get this error described here: http://support.microsoft.com/?id=894573 adding bufferoverflowU.lib to the project will solve that.
NOTE:
I havn't tested it anything yet just compiled a simple windows app and a console app and the TaskManager doesn't say *32 after the process as it would do if it was 32-bit. I don't know if it works with larger projects or anything because I got it working for like 10 minutes ago :)

But I have a question about my newly created 64bit applications (just a simple "hello world" window created by the built in wizard) how can I be sure that it is really 64 bit? the Taskmanager says it is because it doesn't have the *32 but is that enough proof?

EDIT:
you may need to copy the msvcrtd.dll & msvcp60d.dll from PSDK\NoRedist\Win64\AMD\ to where they belong (don't really know) I put them in Windows\System32

[2722 byte] By [McZ] at [2008-2-26]
# 1
Microsoft states that Express Editions do *not* include 64-bit compiler. It would be strange if a workaround to compile 64-bit code in EE existed. But, who knows?
vuki at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 2
vuki wrote:
Microsoft states that Express Editions do *not* include 64-bit compiler. It would be strange if a workaround to compile 64-bit code in EE existed. But, who knows?

So in other words Windows XP 64 runs a 32-bit process on my computer without saying it is an 32-bit process in the TaskManager, 32-bit processes are displayed with *32 after the .exe filename in the taskmanager.

Yes but the VC++ 2005 Express edition couldn't compile standard Win32 code without the PSDK either.. and I don't use the compiler in that comes with the Express edition I use the one that comes with the PSDK.

McZ at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 3
I believe Microsoft says it doesn't support Compiling 64bit code, not that it's impossible.

One way you can verify it's compiling 64bit is to disassemble the .obj

files of your program using DUMPBIN. You'll know it's 64bit if you see

the following registers in the disassembly:

RAX

RBX

RCX

RDX

RSI

RDI

RBP

RSP

R8

R9

R10

R11

R12

R13

R14

R15

RIP/RA

ZombieDeath at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...