CLion 2025.3 Help

Auto-import

When you reference a symbol that has not yet been imported, CLion helps you locate the file – which is typically a header that contains the declaration or definition of that symbol – and adds it to the list of includes.

Import a missing header file

  1. Type a reference to a non-imported class or function.

    Auto-import suggestion
  2. Press Alt+Enter. The import symbol will be added to the imports section:

    Auto-import added
  3. If there are multiple choices for auto import, you will see the corresponding popup:

    Auto-import multiple choices

    Press Alt+Enter and select the preferred option from the list:

    Auto-import multiple choices popup
  4. If the auto-import popup is disabled in Settings | Languages & Frameworks | C/C++ | General, you will see a quick-fix when hovering over a non-imported symbol:

    Auto-import quick-fix

    If there are multiple choices for auto import, click More actions... and select the preferred option from the list:

    Auto-import options

Configure auto-import

There are several settings that control the behavior of the auto-import feature.

  • Enable or disable popups for import actions in Settings | Languages & Frameworks | C/C++ | General:

    Auto-import popup settings
  • You can use auto-importing during code completion, which automatically adds include directives after completing a symbol. Configure this option in Settings | Editor | General | Code Completion:

    Auto-import completion settings

    Select the preferred behavior for importing items from the drop-down list:

    Auto-import completion behavior

    Below, you can also enable or disable the option Add #include after completion of member of incomplete class.

  • There are also two syntax-related options in Settings | Editor | Code Style | C++ | Syntax Style:

    Auto-import syntax style options

    Option

    Functionality

    Sort include directives

    Highlights #include directives that violate the sorting order.

    Use angle brackets instead of quotes

    Allows you to specify cases where generated include directives are added in angle brackets.

    12 February 2026