You need to have UE_BUILD_DEBUG as your build type for that line to work and
#if UE_BUILD_DEBUG
GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Red, "Some Message");
#endif
would be the proper way
Generally messages to the screen are printed something like this
UE_LOG(MyGame, Log, TEXT("Some Messsage") );
I highly reccomend reading Ramas post about debugging and printing messages here
Hope this helps
Don’t forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going.