Building Visual Studio workspaces and makefiles that work equally well for 32 bit x86 and 64 bit IA64 architectures is not an easy task. This document outlines some lessons learned in this process.
Visual Studio by default wants to create different configurations in different directories such as Release or Debug. For the purposes of simplicity with the sample applications we choose to place the output in a Bin directory. It is also important to keep all object files and other compiler generated files separated into x86 and IA64 versions.
For example a project directory tree might look like
Project
Bin
x86
IA64
ps_Win32 - IDL Generated Proxy Stub files for Win32
ps_Win64 - IDL Generated Proxy Stub files for Win64
Proj1__Win32_Debug
Proj1__Win32_Release
Proj1__Win64_Debug
Proj1__Win64_Release
Proxy / Stub dlls are built with output from the MIDL compiler. The default Visual C++ MIDL settings do not output correct IA64 proxy stubs. To have correct stubs you must do the following.
Action | Win32 | Win64 |
Add MIDL compiler directive | /env win32 | /env win64 |
Add define for machine type | _M_X86 | _M_IA64 |
Add output directory | /out ps_Win32 | /out ps_Win64 |
Add win32 define | /D "_WIN32_DCOM" | /D "_WIN32_DCOM" |
When building a project that includes a proxy stub DLL it is best to divide the project into 4 separate projects
The MIDL compiler version 6.0 or higher is required.