x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Factory.generated.h can't be found when including Factory.h from a plugin.

When I include Factory.h in my plugin I get the following build errors:

 1>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor/UnrealEd/Classes/Factories/Factory.h(10): fatal error C1083: Cannot open include file: 'Factory.generated.h': No such file or directory
 1>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor/UnrealEd/Classes/Factories/Factory.h(10): fatal error C1083: Cannot open include file: 'Factory.generated.h': No such file or directory
 1>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor/UnrealEd/Classes/Factories/Factory.h(10): fatal error C1083: Cannot open include file: 'Factory.generated.h': No such file or directory
 1>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\UnrealEdMessages\Classes\AssetEditorMessages.h(5): fatal error C1083: Cannot open include file: 'AssetEditorMessages.generated.h': No such file or directory

Build.cs for the plugin:

 using UnrealBuildTool;
 
 public class SkillSystem : ModuleRules
 {
     public SkillSystem(TargetInfo Target)
     {
         
         PublicIncludePaths.AddRange(
             new string[]
             {
                 "SkillSystem/Public",
                 
             }
             );
                 
         
         PrivateIncludePaths.AddRange(
             new string[]
             {
                 "SkillSystem/Private",
                 "Developer/AssetTools/Public", // Seems like this line isn't actually needed.
                 "Editor/UnrealEd/Classes/Factories", // Seems like this line isn't actually needed.
 
             }
             );
 
         PrivateIncludePathModuleNames.AddRange(
             new string[]
             {
                 
             }
             );
             
         
         PublicDependencyModuleNames.AddRange(
             new string[]
             {
                 "Core",
 
             }
             );
             
         
         PrivateDependencyModuleNames.AddRange(
             new string[]
             {
                 "CoreUObject",
                 "Engine",
                 "Slate",
                 "SlateCore",
                 "UnrealEd", // Also added "UnrealEdMessages" here, but it doesn't solve the AssetEditorMessages error.
                 "AssetTools",
 
             }
             );
         
         
         DynamicallyLoadedModuleNames.AddRange(
             new string[]
             {
                 
             }
             );
     }
 }

The header that includes it (located in the Private folder of my plugin's source) -- note that I have two of those header files in my plugin, the other one is an exact copy but with a different class name:

 #pragma once
 // Includes (include generated file to enable UHT to parse this file).
 #include "Editor/UnrealEd/Classes/Factories/Factory.h" // Switched this out with "UnrealEd.h" and it removes the first 3 errors.
 #include "SkillFactory.generated.h"
 /**
  * Implements UFactory to allow references as assets in the editor.
  */
 UCLASS()
 class USkillFactory : public UFactory
 {
     GENERATED_BODY()
 
 public:
     /** Default constructor. */
     USkillFactory();
     /**
     * Implement the UFactory interface.
     * This allows referencing the given class as an asset.
     */
     virtual UObject* FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
 };

The files for my plugin are in Game/Plugins/Name/Source/Name/ and then split between Public and Private. Both headers in question are in the Private folder.

Note that the headers that include Factory.h are in the private folder, hence why the Dependencies are private. Additionally, I've tried including Object.h before the Factory.h include since it inherits from it, but it seems to be the only dependency for Factory.h, so maybe I'm missing a module or something else.

I've also tried including "Factory.h" only instead of the full path, in that case it simply doesn't find the file.

 1>c:\users\saume\workspace\dungeonhunter\plugins\skillsystem\source\skillsystem\private\SkillFactory.h(6): fatal error C1083: Cannot open include file: 'Factory.h': No such file or directory
 1>c:\users\saume\workspace\dungeonhunter\plugins\skillsystem\source\skillsystem\private\SkillModifierFactory.h(6): fatal error C1083: Cannot open include file: 'Factory.h': No such file or directory
 1>C:\Users\Saume\Workspace\DungeonHunter\Plugins\SkillSystem\Source\SkillSystem\Private/SkillFactory.h(6): fatal error C1083: Cannot open include file: 'Factory.h': No such file or directory
 1>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\UnrealEdMessages\Classes\AssetEditorMessages.h(5): fatal error C1083: Cannot open include file: 'AssetEditorMessages.generated.h': No such file or directory


----------- EDIT: ---------------

I solved the Factory.h problem by changing the include from "Factory.h" to "UnrealEd.h", however, the other error remains:

 1>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\UnrealEdMessages\Classes\AssetEditorMessages.h(5): fatal error C1083: Cannot open include file: 'AssetEditorMessages.generated.h': No such file or directory
 1>C:\Program Files\Unreal Engine\4.10\Engine\Source\Editor\UnrealEdMessages\Classes\AssetEditorMessages.h(5): fatal error C1083: Cannot open include file: 'AssetEditorMessages.generated.h': No such file or directory


I have included "UnrealEdMessages" module in the build and it still doesn't work. I've also tried moving both UnrealEd and UnrealEdMessages to public dependencies just in case and it didn't fix it. I've also tried including "UnrealEdMessages.h" before and after "UnrealEd.h" and the error was still there.

-------------- EDIT 2: --------------

Potentially related to 4.9 bug (though that seems to indicate that your plugin's name needed to start with a number, which isn't my case): https://answers.unrealengine.com/questions/294286/49-cant-include-unrealed-in-plugin-build-cs.html

Product Version: UE 4.10
Tags:
more ▼

asked Dec 12 '15 at 08:07 AM in C++ Programming

avatar image

Saume
3 2 3 7

avatar image RayJohannessen Jan 07 '16 at 05:10 PM

Did you ever get this resolved? I'm having similar issues when trying to create an anim bp node in my editor module...can't find AnimGraphNode_Base.generated.h

avatar image Saume Jan 07 '16 at 11:35 PM

Nope, it seems to be a bug on UE's side, I've tried the same setup, but with the code setup as a different module instead of a plugin and the same error happens, however, from within the main game module everything works fine. Seems like there are problems including editor files from outside the main module.

avatar image RayJohannessen Jan 11 '16 at 09:40 PM

Figured my issue out. Wasn't including the right dependency module (AnimGraph in my case)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question