# Generate definitions

When a function's declaration exists in a class or a namespace but has no implementation yet, you can create definition (implementation) for that function using the Generate definition action.

Procedure: Generate a function definition

1. Place the caret in the editor and do one of the following:

* Press `Ctrl+Shift+D` (Windows), `⌘ ⇧ D` (macOS), `⌘ ⇧ D` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ D` (macOS System Shortcuts), `Ctrl+Shift+D` (XWin), `Ctrl+Shift+D` (GNOME), `Ctrl+Shift+D` (KDE), `Ctrl+Shift+D` (Emacs), `Ctrl+Shift+D` (Sublime Text), `⌘ ⇧ D` (Sublime Text (macOS)), `⌘ ⇧ D` (Xcode), `Ctrl+Shift+D` (Visual Studio), `⌘ ⇧ D` (Visual Studio (macOS)), `Ctrl+Shift+D` (ReSharper), `⌘ ⇧ D` (ReSharper (macOS)), `Ctrl+Shift+D` (QtCreator), `⌘ ⇧ D` (QtCreator (macOS)), `Ctrl+Shift+D` (NetBeans), `Ctrl+Shift+D` (Eclipse), `⌘ ⇧ D` (Eclipse (macOS)).

* Press `Ctrl+Shift+D` (Windows), `⌘ ⇧ D` (macOS), `⌘ ⇧ D` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ D` (macOS System Shortcuts), `Ctrl+Shift+D` (XWin), `Ctrl+Shift+D` (GNOME), `Ctrl+Shift+D` (KDE), `Ctrl+Shift+D` (Emacs), `Ctrl+Shift+D` (Sublime Text), `Ctrl+Shift+D` (Sublime Text (macOS)), `⌘ ⇧ D` (Xcode), `Ctrl+Shift+D` (Visual Studio), `⌘ ⇧ D` (Visual Studio (macOS)), `Ctrl+Shift+D` (ReSharper), `⌘ ⇧ D` (ReSharper (macOS)), `Ctrl+Shift+D` (QtCreator), `⌘ ⇧ D` (QtCreator (macOS)), `Ctrl+Shift+D` (NetBeans), `Ctrl+Shift+D` (Eclipse), `⌘ ⇧ D` (Eclipse (macOS)) and select Generate Definitions: ![The Generate popup](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_GenerateDefinitionsPopup.png)

2. Select one or more functions to generate definitions for:

![The Generate Definitions dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_generateDefinitionsDialog.png)

> **Tip:**
> For member functions, use the Generate in-place checkbox:
>
> * Set this checkbox to generate definitions instead of the declarations inside the class.
>
> * Clear this checkbox to generate definitions outside the class using the scope resolution operator (`::`).

3. Click OK to apply.

## See also

### Procedures

[Generating Code](generating-code.html)

### External Links

[JetBrains Clion Blog](http://blog.jetbrains.com/clion/)

