How to Make Literal in C++ ?

I’m looking for something like this.

I just want to see an error message in the log

I can’t find how to convert a FString to a literal TEXT

How to do it?

Thank you so much!!

ok… i think this can work.
At least there is no compile error.

UE_LOG(LogTemp, Error, TEXT("%s"), *ErrorStr);

source:

What you’re doing here is creating a TCHAR*, not a literal text (FText). You’ve found the correct way to do this, by dereferencing the FString with a *.

For anyone searching, you make a literal text with NSLOCTEXT() or LOCTEXT(). You can make an FText from string with FText::FromString(StringVariable).

2 Likes

Thank you very much for the clarification and for your help! :heart:

1 Like