download links
After installing these, you need to configure Visual C++ Express to compile with the Platform SDK libraries.
go to Tools > Options > Projects and Solutions > VC++ Directories and set the following:
Executable files: C:\Program Files\MS_Platform_SDK\Bin
Include files: C:\Program Files\MS_Platform_SDK\Include
Library files: C:\Program Files\MS_Platform_SDK\Lib
Note: depending on where you installed the platform sdk you may have to use "Microsoft Platform SDK for Windows Server 2003 R2" as "MS_Platform_SDK" above.
Include files: C:\Program Files\MS_Platform_SDK\Include
Library files: C:\Program Files\MS_Platform_SDK\Lib
Note: depending on where you installed the platform sdk you may have to use "Microsoft Platform SDK for Windows Server 2003 R2" as "MS_Platform_SDK" above.
Now, open up the x64 open build debug/retail environment window (came with Platform SDK). It will look like a command-line interface. From that command-line go to the folder where "VCExpress.exe" is located and call it. Now when you build apps it will build with the x64 libraries.
Then, you need to modify some default settings in your projects.
To compile for x64, create 'x64' in the configuration manager for x64 (copy settings from win32), then verify and set the following project settings:
* /MACHINE (Specify Target Platform) is set to /MACHINE:AMD64.
* Register Output is turned OFF.
* If Debug Information Format was set to /ZI in the Win32 project configuration, then it is set to /Zi in the 64-bit project configuration. For more information, see /Z7, /Zi, /ZI (Debug Information Format).
* Values of WIN32 are replaced by WIN64 for /D (Preprocessor Definitions).
* Register Output is turned OFF.
* If Debug Information Format was set to /ZI in the Win32 project configuration, then it is set to /Zi in the 64-bit project configuration. For more information, see /Z7, /Zi, /ZI (Debug Information Format).
* Values of WIN32 are replaced by WIN64 for /D (Preprocessor Definitions).
When linking, if you get errors like:
"error LNK2001: unresolved external symbol _RTC_Shutdown"
then set "Basic Runtime Checks" to Default in the project settings.
When linking, if you get errors like:
fatal error LNK1112: module machine type 'AMD64' conflicts with target machine type 'x64', you need to make sure you use /MACHINE:AMD64 and not /MACHINE:x64. If it won't let you, change to "Not Set", then add it explicitly under Additional Linker Options.
When running your app you may get an error saying msvcrtd.dll not found. Go to your platform SDK folder, and go to noredist/win64/amd64 and you will find it there, copy it into your system32 folder. Don't use the one in noredist/win64/ like i did at first, it doesn't help.
sources:
http://msdn2.microsoft.com/en-us/library/9yb4317s(VS.80).aspx
http://www.planetamd64.com/lofiversion/index.php/t18796.html
http://www.planetamd64.com/lofiversion/index.php/t5934.html
4 comments:
Hi!
Could I install the AMD64 Platform SDK or I should rely on the x86->AMD64 cross compiler from the x86 Platform SDK?
Thanks.
The link in the blogpost shows a link to the Microsoft Platform SDK which includes AMD64 and x86 development environments.
When I did it, I had a 64 bit OS (windows server 2003 x64), then I installed the platform SDK. I launched the "x64 open build debug/retail environment window" (a link to it was installed when I installed the platform SDK). From within that window I launched the x86 IDE, but selected the options to compile to a an x64 binary/executable.
Marker, I need to choose the AMD64 or x86 download of the Platform SDK. I'm still using x86 (my AMD64 will arrive soon). In the x86 Platform SDK install, I may choose x86, IA64 and AMD64 tools - they are cross compilers AFAIK.
But the IDE is x86... Do you have downloaded/installed the AMD64 Platform SDK?
Thanks.
Yes, the IDE is x86. I have not downloaded or installed the AMD64 platform SDK. My comments have to do with the Microsoft Platform SDK which includes both AMD64 and x86 development environments.
I don't have access to Windows Server 2003 x64 anymore so I can't really tell you any more than I already have. What I mentioned was more of a workaround hack, if you are trying to compile a simple program for x64. The project I was researching for, ended up using a linux based x64 solution.
Post a Comment