tomlooman / EpicSurvivalGame

Third-person Survival Game for Unreal Engine (Sample Project)

Home Page:https://www.tomlooman.com/unreal-engine-cpp-survival-sample-game/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation error on 4.20 after last commit

dc740 opened this issue · comments

I tried to compile this for the first time, and the code from this commit gave me some trouble:
e819333

ProcessResult.StdOut: Performing 2 actions (16 in parallel)
ProcessResult.StdOut: [1/2] Compile Module.SurvivalGame.cpp
ProcessResult.StdErr: In file included from /media/dc740/a2be0123-5f46-4405-89f3-475303f5b9b7/Proyectos/UnrealSurvivalGameSeries/SurvivalGame/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/SurvivalGame/Module.SurvivalGame.cpp:31:
ProcessResult.StdErr: �[1m/media/dc740/a2be0123-5f46-4405-89f3-475303f5b9b7/Proyectos/UnrealSurvivalGameSeries/SurvivalGame/Source/SurvivalGame/Private/World/SGameMode.cpp:422:135: �[0m�[0;1;31merror: �[0m�[1m'&&' within '||' [-Werror,-Wlogical-op-parentheses]�[0m
ProcessResult.StdErr: if (!Actor->IsA(ALevelScriptActor::StaticClass()) && !Actor->IsA(ASMutator::StaticClass()) && Actor->GetRootComponent() != nullptr && Actor->GetRootComponent()->Mobility != EComponentMobility::Static || (!Actor->IsA(AStaticMeshActor::StaticClass()) && !Actor->IsA(ALight::StaticClass())))
ProcessResult.StdErr: �[0;1;32m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
ProcessResult.StdErr: �[0m�[1m/media/dc740/a2be0123-5f46-4405-89f3-475303f5b9b7/Proyectos/UnrealSurvivalGameSeries/SurvivalGame/Source/SurvivalGame/Private/World/SGameMode.cpp:422:135: �[0m�[0;1;30mnote: �[0mplace parentheses around the '&&' expression to silence this warning�[0m
ProcessResult.StdErr: if (!Actor->IsA(ALevelScriptActor::StaticClass()) && !Actor->IsA(ASMutator::StaticClass()) && Actor->GetRootComponent() != nullptr && Actor->GetRootComponent()->Mobility != EComponentMobility::Static || (!Actor->IsA(AStaticMeshActor::StaticClass()) && !Actor->IsA(ALight::StaticClass())))
ProcessResult.StdErr: �[0;1;32m ^
ProcessResult.StdErr: �[0m�[0;32m ( )
ProcessResult.StdErr: �[0m1 error generated.
ProcessResult.StdOut: ERROR: UBT ERROR: Failed to produce item: /media/dc740/a2be0123-5f46-4405-89f3-475303f5b9b7/Proyectos/UnrealSurvivalGameSeries/SurvivalGame/Binaries/Linux/libUE4Editor-SurvivalGame.so
ProcessResult.StdOut: (see /home/dc740/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-SurvivalGameEditor-Linux-Development_2.txt for full exception trace)
ProcessResult.StdOut: Total build time: 23.13 seconds (Local executor: 0.00 seconds)
CommandUtils.Run: Took 23.969898s to run mono, ExitCode=5

I "fixed" it by adding extra parenthesis on the first set of AND conditions, like this

if ((!Actor->IsA(ALevelScriptActor::StaticClass()) && !Actor->IsA(ASMutator::StaticClass()) && Actor->GetRootComponent() != nullptr &&
				Actor->GetRootComponent()->Mobility != EComponentMobility::Static) || (!Actor->IsA(AStaticMeshActor::StaticClass()) && !Actor->IsA(ALight::StaticClass())))

Now it compiles just fine.

Thank you

Thanks works on Ubuntu 18.04.1 now with ue4.20.1

Still having the same trouble but now on windows with ue 4.20.2

I tried to generate project files ,because of compilation problems. What should I do with this error?
ERROR: UnrealBuildTool Exception: Visual Studio 2017 requires the Universal CRT to be installed.
I have Win 8.1 64bit.... Universal CRT is installed and Win 8.1 SDK is installed ,too...