Packaging error

1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(34): error C2065: ‘UFactory’: undeclared identifier
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(34): error C2059: syntax error: ‘>’
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(34): error C2976: ‘TArray’: too few template arguments
1> D:\Program Files\Epic Games\4.13\Engine\Source\Runtime\Core\Public\Containers\Array.h(515): note: see declaration of ‘TArray’
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(45): error C2065: ‘UFactory’: undeclared identifier
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(45): error C2059: syntax error: ‘>’
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(45): error C2976: ‘TArray’: too few template arguments
1> D:\Program Files\Epic Games\4.13\Engine\Source\Runtime\Core\Public\Containers\Array.h(515): note: see declaration of ‘TArray’
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(79): error C2065: ‘UFactory’: undeclared identifier
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(79): error C2059: syntax error: ‘>’
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(79): error C2976: ‘TArray’: too few template arguments
1> D:\Program Files\Epic Games\4.13\Engine\Source\Runtime\Core\Public\Containers\Array.h(515): note: see declaration of ‘TArray’
1>D:\Program Files\Epic Games\4.13\Engine\Source\Editor\PropertyEditor\Public\PropertyCustomizationHelpers.h(79): error C3203: ‘TArray’: unspecialized class template can’t be used as a template argument for template parameter ‘OptionalType’, expected a real type

As can be plainly seen, this is in engine code: not something I can fix at the source. And I can’t exactly provide my entire project for the question. Anyone have any ideas where I might start looking for what’s causing this? I have three detail customizations that are my first guess for this, but I’m not sure how to exclude an entire class from the build.

Hello ,

I’m assuming, from the location of your engine installation, that you’re using a binary version of the engine downloaded from the Epic Games Launcher. If that’s not right, please let me know. I have a few questions to ask you to try to narrow this down.

  1. What particular hotfix (4.13.0, 4.13.1, or 4.13.2) are you on?
  2. Does this happen with any project or just your particular one?
  3. Is it a code project or blueprint only?
  4. Are you using any plugins that aren’t activated by default?
  5. Do you have any experimental features enabled?
  6. When you mention that you have “three detail customizations”, can you expand on what you mean by that?
  7. Can you provide the full log from when the packaging attempt failed?

confirmed in different project: it was the classes implementing IDetailCustomization. Wrapping the three classes with #if WITH_EDITOR fixed the above errors.

A new error revealed afterward , Error LNK1181 cannot open input file 'libsndfile-1.lib', was solved by the following change in Build.cs

if (UEBuildConfiguration.bBuildEditor)
        {
            //for detail customization
            PublicDependencyModuleNames.Add("PropertyEditor");
            PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd", "EditorStyle" });
        }

also, make sure that none of those appear in the .uproject file.

PS. Is there another way to make a class ignored by certain builds (eg non-editor)? Using #if WITH_EDITOR seems inelegant.

That would be the primary way to do it, that’s how it’s done throughout the engine as well.