Download

no generated.h file

I am testing a unreal project based on engine 4.11 with a 3rd party plugin. After “generate visual studio project file”, when compiling, VS complains there is no XXX.generated.h file where XXX.h is a header file provided by 3rd plugin. The 3rd plugin is detectable by unreal. So I don’t know why such generated.h file is not automatically generated. Any ideas?

Those header files are created at compile time by Unreal Header Tool so they don’t exist straight away. Something is going wrong during UHT’s parsing process.

generated.h files are also only required if the header file has any unreal-specific types like UCLASS, UENUM, USTRUCT etc. If the file doesn’t contain any of those, it doesn’t need the generated.h and UHT won’t create one for it.

Where have you placed the plug-in in your project folder? And did you delete all these folders before re-creating the solution file - and does the file in question have any UE-types like i mentioned above?

Where have you placed the plug-in in your project folder?

It is in C:\Program Files\Epic Games\UE_4.11\Engine\Plugins.

And did you delete all these folders before re-creating the solution file - and does the file in question have any UE-types like i mentioned above?

Yes, I think so. For example, there is no Intermediate or Binaries folders before project files generating. And the plugin “OptitrackNatNet” was also defined in the Build.cs file as shown below.


using UnrealBuildTool;

public class OffAxisWindow : ModuleRules
{
public OffAxisWindow(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “HeadMountedDisplay”, “OptitrackNatNet”});

PrivateDependencyModuleNames.AddRange(new string] { “Slate”, “SlateCore” });

PublicIncludePaths.AddRange(new string] { “OptitrackNatNet/Public”, “OptitrackNatNet/Classes” });
}
}

I’m fairly sure that if you’re putting it in the engine folder then the plug-in won’t be built with your project, it needs to be in your project folder structure or pre-compiled with the engine.

Could you explain more?

  1. I have tried to put the plugin folder in my project folder in different locations, but doesn’t work. Where should I put it? What’s more, I don’t how the “Generate visual studio project files” can find such plugin files.

  2. By pre-complied with the engine, you mean, I should build the engine from the source with the plugin folder in it?

If you want it to be an Engine Plugin, you need to put it in Engine/Plugin and rebuild the Engine from source. The “Generate Visual Studio” step will search out all the *.build.cs files and should find your plugin. That’s the easiest option IMO.

Thanks! Rebuilding the engine solved this issue!