I’m currently trying to add a custom module to my game, but I got a class in this new module that fails to compile because it cannot include it’s generated.h file
Here is the header of the class :
class SKILLCASTERMODULE_API AEntityManager : public AGameStateBase
std::map<int, AActor*> EntityMap;
void AddEntity(int, AActor*);
This gives me this error :
Cannot open include file: 'EntityManager.generated.h': No such file or directory
2nd time writing this because the web server boned me…again.
Try rebuilding everything from scratch. If you don’t know how, here it is:
- Exit the editor and back up the project (just in case)
- Delete these directories from your project folder tree: .vs, Binaries, Build, Debug, Intermediate, Saved
- Re-generate project files (right-click your uproject file and choose “Generate Project Files”)
- Open the Visual Studio solution (YourProject.sln)
- Build your project for “Development Editor” (should be set already)
If that doesn’t do it then post your CPP file too I guess.
It does not solve the problem.
Here is my cpp file :
PrimaryActorTick.bCanEverTick = true;
EntityMap = std::map<int, AActor*>();
void AEntityManager::AddEntity(int id, AActor* actor)
EntityMap.insert(std::pair<int, AActor *>(id, actor));
CLRService* service = CLRService::GetService();
HINSTANCE dllHandle = service->GetDllHandle();
IntParameterFunc func = (IntParameterFunc)GetProcAddress(dllHandle, "AddCharacter");
Responding to below…
EntityManager.cpp is in the solution, getting built? Is it building EntityManager.gen.cpp? (It will only build it the first time, FYI.) Is there another error before the missing file error?
Does an unaltered C++ template project build OK?
If so, it must be how you’re doing this custom module. The file isn’t getting generated so something must be wrong there. You’ll need to provide more details about the module and how you project is set up.
I’ve succeed to correct this by adding the class through Unreal editor
I’ve had the same problem recently.
My problem was including the header file in a different module (let’s call it
ForeignModule) with path like this:
The correct solution was to include:
"MyModule" to the