Add Include (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Refactor Menu

Refactor > Add Include

Note: This feature comes through Visual Assist.

The Add Include feature inspects if the header for the symbol you invoke it for is included. In case it is not, this feature adds it to the includes at the top of the file.

You can use this feature to write code referring to a type and get it to add the include for you, without having to do it manually or looking up which header defines the type. You can also use this feature when you get a compiler error for an unknown type.

To perform this feature, follow the next steps:

  1. Set the cursor in the symbol.
  2. Go to the Refactor option of the main menu.
  3. Select Add Include.

Add IncludeI.gif

Note: You can also access this feature in the Editor context menu by right-clicking the item to rename and selecting Refactor > Add Include.

Remember you need to put the editor caret inside the symbol you want to add the include for.

See Also