CLion 2021.1 Help

New C/C++ Source/Header File Dialog

This dialog opens when you right-click a file or folder in the Project view and choose one these options from the context menu: New | C++ Class, New | C/C++ Source File, or New | C/C++ Header File.

You can also invoke this dialog by pressing Alt+Insert while in the Project view.

Common Options

ItemDescription
NameIn this field, type the name of a new class or source/header file.
TypeSelect the desired file type from the drop-down list, if you need the type, other than default. For more details on the file type definition, refer to the Code Style C/C++ Help page.
Add to targetsSelect this checkbox to add the created files to the source files list for the selected target(s).
Targets paneIn this pane, select the desired target or multiple targets to which the created files shall be included.
CMakeLists.txt file paneIn this pane, see the CMakeLists.txt variable where CLion suggests to add the created file(s).
Icons general settingsClick this icon to open the Code Style dialog.

New C++ Class

ItemDescription
Create header file onlySelect this checkbox, if you want to create a header file only for a new class.

New C/C++ Source File

ItemDescription
Create an associated headerSelect this checkbox, if you want to created a header associated, with the new source file.
Last modified: 08 March 2021