Compile issues

I have the following headers #include “Grabber.h”
#include “Engine/World.h”
#include “GameFramework/Controller.h”
#include “GameFramework/Actor.h”
#include “Engine/TriggerVolume.h”
#include “GameFramework/PlayerController.h”

I have the following code:
void UGrabber::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
FVector PlayerViewPointLocation;
FRotator PlayerViewPointRotation;

GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(
	PlayerViewPointLocation,
	PlayerViewPointRotation
);



UE_LOG(LogTemp, Warning, TEXT("Location: %s, Rotation: %s")
	*PlayerViewPointLocation.ToString()
	*PlayerViewPointRotation.ToString()
)

// ...

}
(I skipped the define Out step to help troubleshooting)

I get the following errors:
(see …/Programs/UnrealBuildTool/Log.txt for full exception trace)
[1/3] Grabber.cpp
C:\Users\r\Documents\repos\03_buildinge\BuildingEscape\Source\BuildingEscape\Grabber.cpp(50) : error C2678: binary ‘*’: no operator found which takes a left-hand operand of type ‘const wchar_t [27]’ (or there is no acceptable conversion)
C:\Program Files\UE_4.20\Engine\Source\Runtime\Core\Public\Misc/FrameRate.h(251): note: could be ‘FFrameTime operator *(float,FFrameRate)’
C:\Program Files\UE_4.20\Engine\Source\Runtime\Core\Public\Misc/FrameRate.h(246): note: or ‘FFrameTime operator *(double,FFrameRate)’
C:\Program Files\UE_4.20\Engine\Source\Runtime\Core\Public\Misc/FrameRate.h(206): note: or ‘FFrameRate operator *(FFrameRate,FFrameRate)’
C:\Program Files\UE_4.20\Engine\Source\Runtime\Core\Public\Misc/FrameTime.h(230): note: or ‘FFrameTime operator *(FFrameTime,float)’
c:\program files\ue_4.20\engine\source\runtime\core\public\Math/Rotator.h(459): note: or ‘FRotator operator *(float,const FRotator &)’
c:\program files\ue_4.20\engine\source\runtime\core\public\Math/TwoVectors.h(237): note: or ‘FTwoVectors operator *(float,const FTwoVectors &)’
c:\program files\ue_4.20\engine\source\runtime\core\public\Math/Vector.h(1030): note: or ‘FVector operator *(float,const FVector &)’
c:\program files\ue_4.20\engine\source\runtime\core\public\Math/Vector2D.h(552): note: or ‘FVector2D operator *(float,const FVector2D &)’
c:\program files\ue_4.20\engine\source\runtime\core\public\Math/Color.h(390): note: or ‘FLinearColor operator *(float,const FLinearColor &)’
C:\Program Files\UE_4.20\Engine\Source\Runtime\Core\Public\Misc/Timespan.h(804): note: or ‘FTimespan operator (float,const FTimespan &)’
C:\Users\r\Documents\repos\03_buildinge\BuildingEscape\Source\BuildingEscape\Grabber.cpp(53): note: while trying to match the argument list ‘(const wchar_t [27], FString)’
C:\Users\r\Documents\repos\03_buildinge\BuildingEscape\Source\BuildingEscape\Grabber.cpp(50) : error C2955: ‘TIsArrayOrRefOfType’: use of class template requires template argument list
C:\Program Files\UE_4.20\Engine\Source\Runtime\Core\Public\Templates/IsArrayOrRefOfType.h(13): note: see declaration of ‘TIsArrayOrRefOfType’
C:\Users\r\Documents\repos\03_buildinge\BuildingEscape\Source\BuildingEscape\Grabber.cpp(53) : error C2088: '
’: illegal for class
C:\Users\r\Documents\repos\03_buildinge\BuildingEscape\Source\BuildingEscape\Grabber.cpp(50) : error C2672: ‘FMsg::Logf_Internal’: no matching overloaded function found
C:\Users\r\Documents\repos\03_buildinge\BuildingEscape\Source\BuildingEscape\Grabber.cpp(53) : error C2780: ‘void FMsg::Logf_Internal(const ANSICHAR *,int32,const FName &,ELogVerbosity::Type,const FmtType &,Types…)’: expects 6 arguments - 4 provided
C:\Program Files\UE_4.20\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(55): note: see declaration of ‘FMsg::Logf_Internal’
ERROR: UBT ERROR: Failed to produce item: C:\Users\r\Documents\repos\03_buildinge\BuildingEscape\Binaries\Win64\UE4Editor-BuildingEscape-6034.dll

For the life of me, I’ve tried a lot of combinations, just can’t seem to get this to compile.

Follow up: It’s the %s step that seems to be the issue somewhere near there. It works fine if I just remove the %s and references after. But of course, without that I can’t complete the exercise.

Well, I don’t know how to delete stuff here, but I found the issue. I kept getting issues saying it had something to do with “(” but in fact I just forgot a comma. After the TEXT(“X”) make sure you include a comma.

Yup… syntax matters!
Often when you see a whole mess of errors like that its from a missing separator because the compiler has lost track of where to parse things.
(At least you didn’t blame the engine!)

Privacy & Terms