Inconsistent building when packaging game

Ok so I hope its fine i just reference a previews post on AnswerHub. This is a follow up the issues i had when attempting to package my game. Trouble Cooking Game (Program.Main: ERROR: AutomationTool terminated with exception:) - Platform & Builds - Epic Developer Community Forums

is the code that will compile and work as intended in Visual Studio.

 // Member Decleration
     UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Game Instance, Data Tabels")
         TArray<TAssetPtr<UDataTable> > GeneralCraftingRecipts;
 
 // Method
 int32 UMyGameDataTabels::GetGeneralCraftingReciptCount(int32 CraftingLevel)
 {
     bool bIsValid = false;
     UMyGameDataSingleton* Data = UMyGameDataTabels::GetMyGameData(bIsValid);
 
     if (!bIsValid)
         return 0;
 
     if (Data->IsValidLowLevel())
     {
         if (Data->GeneralCraftingRecipts[CraftingLevel]->IsValidLowLevel())
         {
             return (Data->GeneralCraftingRecipts[CraftingLevel]->GetTableData().Num() - 1);
         }
         else {
             FStringAssetReference ReciptRefrence = Data->GeneralCraftingRecipts[CraftingLevel].ToStringReference();
             if (ReciptRefrence.IsValid())
             {
                 UDataTable* NeededReciptTableToLoad = LoadObjFromPath<UDataTable>(FName(*ReciptRefrence.AssetLongPathname)); // Static Library method.
                 if (NeededReciptTableToLoad)
                 {
                     return (NeededReciptTableToLoad->GetTableData().Num() - 1);
                 }
             }
         }
     }
 
     return 0;
 }

But when attempting to package in the editor i get this error.

 MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Engine/DataTable.h(35) : see declaration of 'UDataTable'
 
 MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\MyGameDevTrunk\Source\MyGame\DataTabels\MyGameDataTabels.cpp(124) : error C2228: left of '.Num' must have class/struct/union
 
 MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\MyGameDevTrunk\Source\MyGame\DataTabels\MyGameDataTabels.cpp(133) : error C2039: 'GetTableData' : is not a member of 'UDataTable'
 
 MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Engine/DataTable.h(35) : see declaration of 'UDataTable'
 
 MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\MyGameDevTrunk\Source\MyGame\DataTabels\MyGameDataTabels.cpp(133) : error C2228: left of '.Num' must have class/struct/union

Now i hope am not doing anything dumb in code but to me this make no sense.

Thanks for looking into this.

Cheers!

Hi ,

Do those errors cause your packaging build to fail? Can you include the entirety of you build output log to this thread as a txt file?

You’re packaging for Windows 64? Are you using source or binary?

Thanks!

Sure this is the only log i see generated. from: (.\Saved\Logs)
link text

I have attempted to build both using source and binary.
The attempt is to package for Windows 64 platform but all seem affected.

Also is my DxDiag in case you need it. link text

If there is any more information you need let me know.

EDIT: I did some more testing and now i get the same error when trying to compile in visual studio using source build…
But with binary / retail build it compils in Visual Studio, but will not build/ package from the editor.

Cheers!

The relevant error is this:

ERROR: UBT ERROR: Failed to produce
item:
C:\GameDev\MyGameDevTrunk\Binaries\Win64\MyGame.pdb

So you’ve compiled the editor in VS for Development, Win64 and your project?

Yes that is correct, i just did a Rebuild of the entier thing.
Both project and Editor is buildt with the same configuration.

But this time it compiles in visual studio using source build bbut the error presist within the editor. Just to make the entier thing even more confusing.

is the output from Visual Studio after Building Solution.
Done after the previews mentiond Rebuild.
[link text][2]

EDIT: Realising there is an option named “Development” am rebuilding now…

Can you make sure that the Active Solution Platform is Win64 and not just x64 and try again?

Yes active solution is Win64 and doing a rebuild using Development configuration.

I get this error

MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\GameDev\MyGameDevTrunk\Binaries\Win64\Norse.exe

But source build asside i get the same error using retail build.

Were you able to package your project prior to upgrading to 4.8 (or 4.8.1?)

If so, this could be many things, likely something has become corrupted in the upgrade. First to try:

In the Engine folder, delete the DDC (Derived Data Cache). In your project, delete the Intermediate, the Saved, and the Binary folders.

When you next try to package it will take considerably longer as the shaders will need to newly compile, but this should get rid of any old or corrupted files that haven’t gotten deleted.

If after that you’re still getting the same error, try migrating your project to a blank one in the version of the editor you’re using.

If after that you’re still seeing the build failure, please post fresh output logs.

Thanks!

Ok what i will do for good messure is unzip a clean archive of the engine and recompile it.

But also is there a resson way compiling using Development_Editor (Retail Build) will work. But Selecting Development for the same project will fail with the error above?

So the solution is very simple in the end.

In my attempts to understand the error i never checked the header for UDataTable::.
Well i had a moment of clarity and did and turns out the UDataTable::GetTableData() are for Editor only.

#if WITH_EDITOR

So its stands to reason this will not work.

Well am sorry for reporting a bug report on something that was not.

Regards

No problemo, I’m just glad you’ve sussed it out. Let us know if you need anything else.