I don't have a full blown VS install, only the Microsoft SDK 6.1 in a 32-bit environment. This seems to do the trick from the Microsoft SDK command prompt:
C:\TEMP>vcvarsx86_amd64.bat
Setting environment for using Microsoft Visual Studio 2008 Beta2 x64 cross tools
.
C:\TEMP>cl main.c
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
main.c
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
main.obj
C:\TEMP>
C:\TEMP>vcvarsx86_amd64.bat
Setting environment for using Microsoft Visual Studio 2008 Beta2 x64 cross tools
.
C:\TEMP>cl main.c
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
main.c
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
main.obj
C:\TEMP>
To copy to clipboard, switch view to plain text mode
The resulting main.exe cannot run on this machine. The batch file (you'd have to dissect yours) tweaks the LIB, LIBPATH, and PATH variables to put the 64-bit cross-compiler and 64-bit libraries in the mix before any others.
I did think the compiler had a "/MACHINE" option to set the target but that appears to be wrong.
Bookmarks