VS2013 Build fails after removing custom class

If you add a class to a project that had no code, then remove that class and try to build the project it fails. The failure is because a ‘generated.inl’ include file is not generated because there are no custom classes.

NOTE: This only happens if ALL custom classes are removed. As long as you have at least one custom class it will generate a proper ‘generated.inl’ include file.

Steps to reproduce:

  1. Create a new Blank project without starter content.
  2. Select File → Add Code to Project…
  3. Choose Actor → Select Next.
  4. Name the Actor. (I used Test)
  5. Select ‘Create Class’.
  6. When prompted to edit code now select ‘Yes’.
  7. Close Unreal Editor.
  8. Remove Test.cpp and Test.h from the Solution.
  9. Open a file explorer and find both Test.cpp and Test.h files inside of your project’s Source folder and delete them from the disk.
  10. Back in VS2013 select ‘Build’ → ‘Clean Solution’
  11. After that is done cleaning the solution select ‘Build’ → ‘Build Solution’

Hi Apoc,

I was able to successfully reproduce this and have attached this as well as my findings to a bug report for assessment. Thank you and have a great day!

FYI, this is because when I code project is create we add the *.generated.inl include to one of its cpp file. This is for convenience, otherwise that file would have to be included manually to prevent linker errors. *.generated.inl file contains generated code for the UObject-derived classes. When all classes are removed, so does the inl file because there’s no more code to generate.

Note that we have a fix for this which will be integrated into one of the future releases.