How to delete class?

All you need to do is delete the files in Explorer, just like any other file. UBT will scan for any file/folder changes everytime it runs, and will invoke UHT to create/remove any required generated.h files.

If you have source control (which you should) and the files are already part of your repository, you can sometimes just Right-Click and ‘Remove’ them in the Solution Explorer. This depends on the Source Control extension you are using, but it should delete the file too.

To be honest there should rarely be a need to regenerate all your files unless something goes really wrong, or unless you just want a ‘Clean’ build. Sometimes however, if you are making a lot of changes to folder structure or renaming files, it’s easier to just do all of that in Explorer then regenerate the solution file so you don’t have to mess around with the filters.

This goes without saying, but the editor should not be open when you remove classes.

1 Like