Error C2039: 'CreateTableFromCSVString' : is not a member of 'UDataTable'

Hi I have following error coming out only when packaging (when compiling via Visual Studio 2013 everything is ok):

The critical line is here I guess:

MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Users\Grzegorz\Downloads\projekt_kopia\Source\Test\BPFunctionLibrary.cpp(21) : error C2039: 'CreateTableFromCSVString' : is not a member of 'UDataTable'

The rest of error:

MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: C:\Program Files\Epic Games\4.9\Engine\Binaries\DotNET\UnrealBuildTool.exe Test Win64 Shipping  C:\Users\Grzegorz\Downloads\projekt_kopia\Test.uproject  -noxge -generatemanifest -rocket -NoHotReloadFromIDE
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 2,6220435s to run UnrealBuildTool.exe, ExitCode=0
MainFrameActions: Packaging (Windows (64-bit)): UE4Build.PrepareManifest: Copied UBT manifest to C:\Users\Grzegorz\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+4.9\UBTManifest.0.xml
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: C:\Program Files\Epic Games\4.9\Engine\Binaries\DotNET\UnrealBuildTool.exe Test Win64 Shipping  C:\Users\Grzegorz\Downloads\projekt_kopia\Test.uproject  -noxge -rocket -NoHotReloadFromIDE -ignorejunk
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Performing 6 actions (4 in parallel)
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: PCH.Test.h.cpp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: BPFunctionLibrary.cpp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Test.cpp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: DataStructure.cpp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Test.generated.cpp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Users\Grzegorz\Downloads\projekt_kopia\Source\Test\BPFunctionLibrary.cpp(21) : error C2039: 'CreateTableFromCSVString' : is not a member of 'UDataTable'
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool:         C:\Program Files\Epic Games\4.9\Engine\Source\Runtime\Engine\Classes\Engine/DataTable.h(33) : see declaration of 'UDataTable'
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\Users\Grzegorz\Downloads\projekt_kopia\Binaries\Win64\Test-Win64-Shipping.exe
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Total build time: 93,44 seconds
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 93,5029912s to run UnrealBuildTool.exe, ExitCode=5
MainFrameActions: Packaging (Windows (64-bit)): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: Exception in AutomationUtils.Automation: Command failed (Result:5): C:\Program Files\Epic Games\4.9\Engine\Binaries\DotNET\UnrealBuildTool.exe Test Win64 Shipping  C:\Users\Grzegorz\Downloads\projekt_kopia\Test.uproject  -noxge -rocket -NoHotReloadFromIDE -ignorejunk. See logfile for details: 'UnrealBuildTool-2016.01.23-19.46.11.txt' 
MainFrameActions: Packaging (Windows (64-bit)): Stacktrace:    w AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary`2 EnvVars)
MainFrameActions: Packaging (Windows (64-bit)):    w AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary`2 EnvVars)
MainFrameActions: Packaging (Windows (64-bit)):    w AutomationTool.UE4Build.BuildWithUBT(String ProjectName, String TargetName, UnrealTargetPlatform TargetPlatform, String Config, String UprojectPath, Boolean ForceMonolithic, Boolean ForceNonUnity, Boolean ForceDebugInfo, Boolean ForceFlushMac, Boolean DisableXGE, String InAddArgs, Boolean ForceUnity, Dictionary`2 Env
MainFrameActions: Packaging (Windows (64-bit)): Vars)
MainFrameActions: Packaging (Windows (64-bit)):    w AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable`1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InUseParallelExecutor, Boolean InForceNonUnity, Boolean InForceUnity, Boolean InShowProgress, Dictionary`2 PlatformEnvVars)
MainFrameActions: Packaging (Windows (64-bit)):    w Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL)
MainFrameActions: Packaging (Windows (64-bit)):    w BuildCookRun.DoBuildCookRun(ProjectParams Params)
MainFrameActions: Packaging (Windows (64-bit)):    w BuildCommand.Execute()
MainFrameActions: Packaging (Windows (64-bit)):    w AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)
MainFrameActions: Packaging (Windows (64-bit)):    w AutomationTool.Automation.Process(String[] CommandLine)
MainFrameActions: Packaging (Windows (64-bit)):    w AutomationTool.Program.MainProc(Object Param)
MainFrameActions: Packaging (Windows (64-bit)):    w AutomationTool.InternalUtils.RunSingleInstance(Action`1 Main, Object Param)
MainFrameActions: Packaging (Windows (64-bit)):    w AutomationTool.Program.Main()
MainFrameActions: Packaging (Windows (64-bit)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: AutomationTool exiting with ExitCode=5
MainFrameActions: Packaging (Windows (64-bit)): Domain_ProcessExit
MainFrameActions: Packaging (Windows (64-bit)): copying UAT log files...
MainFrameActions: Packaging (Windows (64-bit)): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (Windows (64-bit)): BUILD FAILED

This is BPFunctionLibrary.h:

#pragma once

#include "Engine/DataTable.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "BPFunctionLibrary.generated.h"

/**
 * 
 */
UCLASS()
class VIRTUALHOME_API UBPFunctionLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
	
public:
	UFUNCTION(BlueprintCallable, Category = "BPFunctionLibrary")
		static UDataTable* ReimportDataTable();
	
	
};

This is BPFunctionLibrary.cpp:

#include "Virtualhome.h"
#include "BPFunctionLibrary.h"

UDataTable* UBPFunctionLibrary::ReimportDataTable() {

	//Create DataTable object holding csv data
	//UDataTable* myDataTable = static_cast<UDataTable*>(StaticLoadObject(UDataTable::StaticClass(), NULL, TEXT("/Game/Data/Lista.Lista")));
	UDataTable* Lista;
	static ConstructorHelpers::FObjectFinder<UDataTable>
		Lista_BP(TEXT("myDataTable'/Game/Data/Lista.Lista'"));
	Lista = Lista_BP.Object;

	FString csvFile = FPaths::GameContentDir() + "Lista.csv";

	if (FPaths::FileExists(csvFile))
	{
		FString FileContent;

		//Read the csv file from game's content
		FFileHelper::LoadFileToString(FileContent, *csvFile);
		TArray<FString> problems = Lista->CreateTableFromCSVString(FileContent);
		UE_LOG(LogTemp, Warning, TEXT("Content is %s"), *FileContent);

		if (problems.Num() > 0)
		{
			for (int32 ProbIdx = 0; ProbIdx < problems.Num(); ProbIdx++)
			{
				//Log the errors
				UE_LOG(LogTemp, Warning, TEXT("Problem with reimport!"));	
			}
		}
		else
		{
			//Updated Successfully
			UE_LOG(LogTemp, Warning, TEXT("Successful reimport!"));
		}


	}

	return Lista;
}

Hello,

I am attempting to reproduce this issue on my end, and I will provide updates as soon as I can.

In the meantime, can you please try upgrading this project to 4.10 and then to 4.11 and packaging it in those versions to see if you are getting the same error?

Hello,

I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day

This issue persists. Here is the thread with details: error C2039: 'CreateTableFromCSVString' : is not a member of 'UDataTable' - C++ - Unreal Engine Forums

Hello,

I have investigated this issue further, and have received some information that I feel will be helpful to you when you’re trying to work out this problem.

In general, things that deal with reading XML or CSV files are usually editor-only. Those functions are not intended to be used in packaged games, but they will work in editor. The behavior we’d encourage is to do all your XML or CSV in the editor, save that to a normal binary asset, and then not do it in packaged games. You can use #if WITH_EDITOR blocks to make the CSV or XML oriented functions only appear in editor mode.

This information should give you a good starting point to begin rethinking how you want to work out your problem.

Have a great day

Thanks for being so helpful. I have just worked this out on my own (with a little help of Epic Dev - Jamie Dale). I have derived from UDataAsset and created TMap and two arrays for row names and rowhandle structs. Then I implemented reading csv from file and thanks to FCsvParser I was able to parse csv info TMap I have created earlier. Then I created getRowNames and GetStructs methods and exposed them to my BP function library in order to use it in editor. That’s a workaround I have created to dynamically reimport data from my csv in real-time and display it on screen via UMG widget. The most beautiful thing about this one is it works perfectly in packaged games.

Have a great day

Hello Xter,Can your share some idea that how to solve this problem,it is useful to me,thank you.

Hi Malloc007, were you able to solve this? I am trying to read a csv file in real time, but I am new to c++ in Unreal, so any help would be appreciated.