(Beginner at C++), I’m currently updating a project from UE4.27 to UE5.2 and I get many (99+) FVector and FRotator errors when trying to build my project.
You are missing an include in your header. Your file should look something like this:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
// then an include of the class that your class extends
#include "YourClassName.generated.h"
/// etc
You shouldn’t be getting any errors from inside SpringArmComponent.h as you shouldn’t be modifying it directly.
I’m guessing the main culprit could be a missing #include "CoreMinimal.h" as it includes all of the base struct definitions down the chain such as FVector.
Did not make any changes in SpringArmComponent or any other headers/classes from the Engine itself, I’m 100% sure. Ended up reinstalling UE5 and I’m still getting the same error.
When trying to build projects that don’t contain any FVectors in code, they build just fine.
Tried to build the project I’m updating on UE4.27, it built correctly again.
On UE5.2 however, the same project suddenly fails.
I believe the error isn’t even in FVector itself possibly, but maybe Visual Studio (also tried Rider, same problem) or UE itself.
After the upgrade I’m guessing you didn’t modify the target files to use 5.2 build order.
It might still be using 4.27’s build order, that might be throwing off the compiler.
example of a target file that updates the build order to 5.2:
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class yourGameNameTarget : TargetRules
{
public yourGameNameTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V5;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2;
ExtraModuleNames.Add("yourGameName");
}
}
Remember that there are at least 2 target files. One for the game, one for the editor, if you are using a dedicated server then you will have a third regarding the server.
Inside of your uproject file you should have the line near the top below fileVersion
That could very well have been the issue as I was on V2 previously, but now I’m getting a
error CS0117: ‘BuildSettingsVersion’ does not contain a definition for ‘V5’
error CS0117: ‘BuildSettingsVersion’ does not contain a definition for ‘V5’
I tried V3 and V4 too, V3 had same issue as V2, V4 as V5
Unfortunately with Latest I’m right back to FVector errors.
I believe the problem stems from it not recognizing V5 in the first place, maybe as Latest it still uses V3 and sadly even changing the Project Version (which should have already been 5.2) didn’t seem to help.