How to: Enable IntelliSense for Makefile Projects

IntelliSense fails to operate in the IDE for Visual C++ makefile projects when certain project settings, or compiler options, are set up incorrectly. Use this procedure to configure Visual C++ makefile projects, so that IntelliSense works when makefile projects are open in the Visual Studio development environment.

To enable IntelliSense for makefile projects in the IDE

  1. Open the Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. Expand the Configuration Properties node.

  3. Select the NMake property page, and then modify properties under IntelliSense as appropriate.

    • Set the Common Language Runtime Support property for projects (or files) that contain managed code. See /clr (Common Language Runtime Compilation), for more information.

    • Set the Preprocessor Definitions property to define any preprocessor symbols in your makefile project. See /D (Preprocessor Definitions), for more information.

    • Set the Additional Include Directories property to specify the list of directories that the compiler will search to resolve file references that are passed to preprocessor directives in your makefile project. See /I (Additional Include Directories), for more information.

      For projects that are built using CL.EXE from a Command Window, set the INCLUDE environment variable to specify directories that the compiler will search to resolve file references that are passed to preprocessor directives in your makefile project.

    • Set the Forced Includes property to specify which header files to process when building your makefile project. See /FI (Name Forced Include File), for more information.

    • Set the Assembly Search Path property to specify the list of directories that the compiler will search to resolve references to .NET assemblies in your project. See /AI (Specify Metadata Directories), for more information.

    • Set the Forced Using Assemblies property to specify which .NET assemblies to process when building your makefile project. See /FU (Name Forced #using File), for more information.

  4. Click OK to close the property pages.

  5. Use the Save All command to save the modified project settings.

    Note

    In order for IntelliSense to work, you must close the solution that contains your makefile project and then delete any previously generated .ncb files.

The next time you open your makefile project in the Visual Studio development environment, run the Clean Solution command and then the Build Solution command on your makefile project. IntelliSense should work properly in the IDE.

See Also

Tasks

How to: Create a C++ Project from Existing Code

Concepts

NMAKE Reference

Other Resources

Using IntelliSense