[Closed] How do I remove a C++ class from my project code?
There seems to be no way to remove a c++ class from your code after it has been added using the "Add code to project" from the editor. Running custom compiled UE 4.6 Deleting the .h and .cpp files relating to the class does not do anything at all , you can still see the class in the editor even if you exit and reload the project.
Also It magically opens the header files even after its deletion from the vs solution explorer.
The only way I figured out is that you need to clean your project and rebuild it but in custom compiled engine cleaning the project ("YES I used clean project only") results in rebuilding the whole editor and engine again which is like compiling 1300+ cpp files for an hour.
This means I have to waste an hour even If I just made a simple spelling mistake in class name in "Add Code to project"
Is there any feasible way to remove a c++ class or at-least to rename it ?
The question has been closed Apr 25 '16 at 09:28 PM by Tim Lincoln for the following reason:
The question is answered, right answer was accepted
I did it using the following steps (with UE4.6.1):
If you need to rename a class you can rename the files on disk instead of step 2 and 3 (and then adapt the code to get classname matching filename)
Hope it will work for you too.
answered Jan 30 '15 at 11:52 AM
My general practice is:
Generally deleting the files only removes it from your solution, and I find the some how the build tool still fines any file you just "removed" from the solution (at least that's my experience). So after removing it from your solution in VS you need to physically delete the files from your source folder.
Now because there is an intermediate folder where some more build tool magic happends I generally perform a clean which ungunks any left over artifacts of the file I just deleted (you can also just delete the intermediate folder). Finally a fresh build (as long as all my references are gone) finishes the job by rebuilding the intermediate folder and generating my dlls.
answered Apr 14 '15 at 04:17 PM
Did you remember to delete every reference of the desired and created class before deleting?, The recration of the class is because of recalling from different modules, and fails, creating a new one. I haven't tried to delete a class so this is just a guess. Good luck :)
answered Jan 30 '15 at 08:26 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here