# Cannot package project due to use of a Factory

**URL:** <https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063>\
**Category:** Platform & Builds\
**Tags:** package, unreal-engine, CPP, question\
**Created:** [April 13, 2016, 6:30pm UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063 "2016-04-13T18:30:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [April 13, 2016, 6:30pm UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063/1 "2016-04-13T18:30:33Z")

</div>

I use a custom factory in my project to allow easy creation of custom assets in the editor. When I try to package my project, I get an error saying “Cannot open include file: ‘Factory.generated.h’: No such file or directory”.

My build output is here in case anybody wants to see it: [http://pastebin.com/raw/iJhc7CtG](http://pastebin.com/raw/iJhc7CtG)

I understand Factories are really only useful when developing in the editor, is there some way to conditionally exclude them from the build process when packaging?

Thanks!

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [April 30, 2016, 12:25am UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063/2 "2016-04-30T00:25:24Z")

</div>

Are factories something that should be stopping the packaging process in the first place?

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [May 2, 2016, 6:56pm UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063/3 "2016-05-02T18:56:17Z")

</div>

This is a much simpler question, could I at least get an answer to this?

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [May 27, 2016, 5:28pm UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063/4 "2016-05-27T17:28:08Z")

</div>

Post is now six weeks old, bump

---

<div class="post-metadata">

**Author:** ![Smerom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Smerom](https://forums.unrealengine.com/u/Smerom)\
**Post date:** [May 28, 2016, 2:34am UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063/5 "2016-05-28T02:34:43Z")

</div>

I had a similar problem with a \*.generated.h not being found/built. Ended up deleting the “./Intermediate/Build” folder of the project to fix it. The next build time was a bit of a bear, but it fixed the problem for me. Wasn’t related to a factory class though.

If that doesn’t work, I think I also greped for files under “./Intermediate” containing references to the offending header and deleted some those as well.

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [July 21, 2016, 7:49pm UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063/6 "2016-07-21T19:49:38Z")

</div>

Extremely simple question, post is now over 3 months old

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [August 2, 2016, 4:11pm UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063/7 "2016-08-02T16:11:44Z")

</div>

This did not fix the issue. Thanks though.

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [August 2, 2016, 11:30pm UTC](https://forums.unrealengine.com/t/cannot-package-project-due-to-use-of-a-factory/354063/8 "2016-08-02T23:30:53Z")

</div>

UFactory is declared at:

Module: UnrealEd

Header: **Editor/UnrealEd** /Classes/Factories/Factory.h

You cannot package a game shipping Editor modules. If you want to use factories, you must create a Module with IMPLEMENT\_MODULE() macro and create your factories in there; making sure that module will NOT be loaded by GAME modules. This is why your packaging fails, because you implement references to classes that are Editor only.

To create an Editor Module for your game project, look at a guide here:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...
