In UE4.20 I have created a new plugin via the editor’s plugin window. Then I added a new class to that plugin via the “Create C++ class” menu item. However, after a full rebuild of the project in Visual Studio 2017 now the generated.h file of the plugin is missing, so the project cannot be compiled. I tried to delete the Intermediate, Build, Saved, .vs folders, both for the project and the module, I deleted the .sln file and regenerated the VS project via context menu of the .uproject file.
However, nothing of this worked, the generated.h file is still missing.
Any odther ideas?
I’ve had all kinds of problems when working with plugin c++ or regular classes for that matter. First are your source files/directories is the normal directory structure? If they are for me I usually close the project in Editor, clean command in visual studio, close visual studio and reopen project. It seems to scan the folders, add the needed generated headers etc and fix the solution file.
Assuming you right-clicked .uproject and “Generate Project Files”? This is what generates the generated.h.
(Make sure no errors are occuring during this - it is hard to see the output in the window. Sometimes you have to execute the command from a terminal to see output)
Yes, this is exactly what I am doing. But I am not sure whether an error occurs, the window disappears immediately.
What is the command to regenerate project files from the command line?
However, still no generated.h file. I noticed now that no such generated header file is created for the whole project at all, i.e. not only those for the module are missing
Ok guys, I found the error: In one of the header files within the custom plugin there was fhe following piece of code:
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "Mapper.generated.h"
class MappingHelper // HERE IS THE PRBOBLEM THE ; WAS MISSING !!
UCLASS()
class MAPPING_SYSTEM_API Mapper : public UObject
{
GENERATED_BODY()
/// and some more stuff ...
};
So all that was missing is the semicolon ; in the line “class MappingHelper”. Probably because it interferred with the UCLASS() macro in the next line …
Anyways, problem was a bug in my own code
Thanks for your help everyone!