Hello Ville,
Thanks for your contribution on the NXP community!
I've tried it on my side, but I cannot reproduce it.
Where did you put your new file? into "src" source folder?
If you create a new generic folder in your project or if you e.g. copy a folder with source files into your project it may not be considered as a source folder.
The generic folder has this icon: 
The source folder icon has little "C" letter above: 
Please make sure your new .cpp file is located in a source folder.
If you need to change generic folder to source one (and vice versa): right click on the folder and select "Resource Configurations" -> "Exclude from Build...". Then uncheck the check box for specific Build configuration that should consider this folder as source one.
You can do the same in Build configurations dialog: click in Project Explorer area -> "Build Configurations Explorer". This dialog is more convenient if you need to select/de-select multiple files/folders into a build config.
If the info above does not help .... Can you please post reproducible step-by-step instructions?
Thanks
Stanislav