You can quickly generate definitions for the existing declarations by pressing &shortcut:Diff.ShowSettingsPopup; (Code | Generate Definitions ).
When creating definitions, CLion detects the patterns that you use in the project:
- declarations are located in header files, while definitions are in cpp-files
- class/struct is located in header file only
- class/struct is located in cpp-file only
When you switch from one pattern to another (by using the Generate in-place option), CLion picks it up and behaves accordingly next time you use code generation.