This “How-to” applies to the Windows SDK for Vista, the SDK Update for Vista, and the SDK for Server 2008.
(In order to build the samples in the SDK build environment or in Visual Studio 2008, the Win32 samples project files must be upgraded. This is not necessary when building the samples with Visual Studio 2005. For more information, see SDK Workaround: VCProj Files Require Upgrade Prior to Building.)
To build from the SDK command line:
1. Copy your application or sample to a working folder not under \Program Files.
2. Open the Windows SDK CMD shell (Start, All Programs, Windows SDK Vx, SDK CMD Shell).
3. Navigate to directory where your sample or application can be found.
4. Build a sample or project from the command line as follows:
- Build a makefile by typing nmake
- Build a .csproj file by typing msbuild *.csproj /p:platform=[ win32 | X64 | IA64]
- Build a .vbproj file by typing msbuild *.vbproj /p:platform=[ win32 | X64 | IA64]
- Build a .sln file by typing msbuild *.sln /p:platform=[ win32 | X64 | IA64]
- Build a .vcproj by typing vcbuild *.vcproj /platform=[ win32 | X64 | IA64 ]
When building with MSBUILD, you should specify a target platform. If a project is configured to build for several different platform types and you don’t specify which platform you wish to build for, the first platform listed in the solution or project file will be built. Configurations are listed in alphabetical order by Visual Studio, so ‘Itanium’ may be the first configuration listed.
If you want to build an application configured for an X86 machine, specify ‘win32’:
msbuild mysample.vbproj /p:platform=win32
If you want to build an application configured for an X64 machine, specify ‘X64’:
msbuild mysample.vbproj /p:platform=X64
If you want to build an X64 application but your project doesn’t have an X64 configuration, see How to Add 64-bit Support to VCProj Files.
K a r i n M e i e r
Windows SDK | Samples & Community PM