Microsoft KB Archive/172198

= How To Build Exchange Samples Using Visual C++ Projects =

Article ID: 172198

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Exchange Development Kit 5.5
 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Professional Edition

-



This article was previously published under Q172198



SUMMARY
The Platform SDK (Software Development Kit) Exchange Samples all have makefiles and can be built by running nmake from the command window. If you are modifying the sample code or wish to include it in an existing project you may need a Microsoft Visual C++ project to build an Exchange sample. To create or modify Microsoft Visual C++ projects to build Exchange samples follow the steps outlined below.



Steps to Build Samples
 Change to the directory containing the sample code and verify that you can build the sample using nmake from the command line. The Exchange sample makefiles build a debug version by default. If you want to create a retail build, use the following:

nmake BLDTYPE=Retail

This step verifies that you have everything needed to build the sample and generates a win32 subdirectory tree under the sample code directory, which contains files that you will use later. Make sure you have set up Microsoft Visual C++ to use the Platform SDK include and lib directories. Assuming you have installed the SDK in MSSDK, you can set these by selecting Options from the Tools menu, selecting the Directories tab, adding MSSDK\Include to the Include files list of directories and adding MSSDK\Lib to the Library files list of directories. Select Settings from the Project menu and select the C/C++ tab. Select the "Code Generation" category, select Debug Multithreaded DLL (or Multithreaded DLL for a release build) for the run-time library. Add the sample files to the project (.c, .cpp, .rc and .def). If the sample project contains .mc (message compiler) files, you need to add the MC generated header (.h), resource (.rc) and binary (.bin) files to the sample code directory. If you ran nmake in step 1, the necessary files are in the Win32/Debug or Win32/Release subdirectories created in step 1. The Win32/Debug or Win32/release subdirectory should contain a libfiles.lst file that lists all the .lib files needed to build the project. You should read this file and add all the .lib files listed that are not already present in the "Object/library modules" box on the Link tab of the Project Settins dialog box (select Settings from the Project menu). Checking "Ignore all default libraries" may avoid LNK4098 warning messages in some samples.

You should now be able to build the sample using the Microsoft Visual C++ project.

Keywords: kbhowto kbapi kbmsg KB172198

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.