Error: Too many actual parameters for macro TEXT

The parameter arguments parameters should go to UE_LOG, not TEXT macro. There no such things as “UE4 C++”, it still 100% valid C++ and those macros are delered somewhere, if you look on there declarations you would noticed where arguments should go.

Hi,
I have experience with programming and experience with Unreal Engine 4, but I’m still very new to Unreal Engine 4 C++ programming.

Error: Too many actual parameters for macro TEXT
Error: Failed to produce item: C:\Users\Quinton\Desktop\MyProject\Binaries\Win64\UE4Editor-MyProject-5161.dll

When I remove *ObjectName from the TEXT I don’t get the compiler error.

You’ve got your brackets in the wrong place. You have:

UE_LOG(LogTemp, Warning, TEXT("my info: %s", *MyVariable))

Where as it should be

UE_LOG(LogTemp, Warning, TEXT("my info: %s"), *MyVariable)

This is because it is the UE_LOG macro which expects to have 3 or more paramters passed into it (where the 4th, 5th,6th etc should correspond to what you want to print in the text. The TEXT macros should only ever have one parameter.

An example of something which uses more variables would be:

UE_LOG(LogTemp, Display, TEXT("my info: %s with value %f, %s"), *MyFirstString, MyFloat, *MySecondString)

Thank You, I can’t believe I missed that.