How can this 'LLOCTEXT_NAMESPACE': undeclared identifier error be resolved in C++?

error C2065: ‘LLOCTEXT_NAMESPACE’: undeclared identifier
error C2661: ‘IDesktopPlatform::OpenFileDialog’: no overloaded function takes 6 arguments

TArray<FString> UFixedPointBrowseBPLibrary::OpenFilesDialog()
{
	TArray<FString> OutFiles;
	FDesktopPlatformModule::Get()->OpenFileDialog(FSlateApplication::Get().FindBestParentWindowHandleForDialogs(nullptr),
		TEXT("select file"),
		TEXT("/"),
		TEXT(""),
		//TEXT("All Files (%s)|%s|%s"),
		//TEXT("(Image Files)|*.BMP;*.JPG;*.PNG;*.JPEG;)"), //.xls/.xlsm/.csv/
		LOCTEXT("Excel", "Trace files (*.xls)|*.xls;*xlsx;*.xlsm;*.csv|All files (*.*)|*.*").ToString(),
		(uint32_t)EFileDialogFlags::None,
		OutFiles
	);
	return OutFiles;
}

Hi Mirro1871,

You’ll need to define your namespace at the top of your cpp file (below includes):

#define LOCTEXT_NAMESPACE "MyNameSpace"

If you search the UE sourcecode for “LOCTEXT_NAMESPACE” you’ll see plenty of examples…

1 Like