Doing the Code a First-Person Adventure Game and wondering if compile errors are UE or VS?

I’m following this tutorial Set Up and Compile a C++ Project in Unreal Engine | Unreal Engine 5.6 Documentation | Epic Developer Community and when I write the code save the .h and .cpp then compile in VS i always get about 66 errors most being E0070, and a MSB3073. I’m just not sure if its VS or Unreal, maybe something isn’t set up right but i did the VS set up at the beginning, and made sure live coding is off in Unreal but idk I’m stumped, here is the code, the way VS is set up and the actual errors.



identifier “nullprt” is undefined
incomplete type “SlateAttributePrivate::TSlateAttributeBase<SWidget, TOptional, std::conditional<true, SlateAttributePrivate::FSlateAttributeNoInvalidationReason, TSlateAttributeInvalidationReasonEInvalidateWidgetReason::None>::type, TSlateAttributeComparePredicate<TEqualTo>, SlateAttributePrivate::ESlateAttributeType::Member>::ObjectType” (aka “TOptional<TTransform2>”) is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional<const FRHIDrawStatsCategory *>” is not allowed
incomplete type “TOptional<const FRHIDrawStatsCategory *>” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptionalEMouseCursor::Type” is not allowed
incomplete type “TOptionalENamedThreads::Type” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptionalFBodyInstance::FAsyncTermBodyPayload” is not allowed
incomplete type “TOptional” (aka “TOptional<UE::Math::TBoxSphereBounds<double, double>>”) is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” (aka “TOptional<UE::Math::TIntPoint>”) is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptionalFMaterialLayersFunctions::ID” (aka “TOptional”) is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional<FRHIBreadcrumbNode *>” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” is not allowed
incomplete type “TOptional” (aka “TOptional<UE::Math::TTransform>”) is not allowed
incomplete type “TOptional” (aka “TOptional”) is not allowed
incomplete type “TOptional” (aka “TOptional”) is not allowed
incomplete type “TOptional” (aka “TOptional”) is not allowed
incomplete type “TOptional” (aka “TOptional”) is not allowed
incomplete type “TOptional” (aka “TOptional”) is not allowed
incomplete type “TOptional” (aka “TOptional”) is not allowed
incomplete type “TOptional” (aka “TOptional”) is not allowed
incomplete type “TOptional<TCircularBuffer<TUniquePtr<FBitReader, TDefaultDelete>>>” is not allowed
incomplete type “TOptional<TSharedRef<const SWidget, ESPMode::ThreadSafe>>” is not allowed
incomplete type “TOptional<TSharedRef<SWidget, ESPMode::ThreadSafe>>” is not allowed
incomplete type “TOptionalUEditorEngine::FLauncherCachedInfo” is not allowed
incomplete type “TOr<TAndValue<, TIsPODType<TOptional>>, TIsArithmetic<TOptional>>” is not allowed
The command ““C:\Program Files\Epic Games\UE_5.6\Engine\Build\BatchFiles\Build.bat” AdventureGameEditor Win64 Development -Project=“C:\Users\USER\Documents\Unreal Projects\AdventureGame\AdventureGame.uproject” -WaitMutex -FromMsBuild -architecture=x64 -WorkingDir=C:\Users\USER\Documents\Unreal Projects\AdventureGame\Intermediate\ProjectFiles -Files=....\Source\AdventureGame\AdventureGameMode.cpp” exited with code 8.

It looks like a setup issue—double-check your Visual Studio installation and Unreal Engine settings. Even small missteps can cause those kinds of errors.

1 Like

It’s better to look at the “Output” tab instead of the “Error List”. Something simple can cause a cascade of unrelated issues. In your case, you can see the first issue is

identfier "nullprt" is undefined

That should be nullptr. Looks like line 10 of AdventureGameMode.cpp, you have check(GEngine != nullprt). Change that to check(GEngine != nullptr) and recompile.

Naturally you could have a busted installation, however, fix this first and go from there.

1 Like

oh shoot thanks, fixed the typo but it still gives a failed complie, the bottom of my output logs this

1>Result: Failed (RulesError)
1>Total execution time: 4.55 seconds
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(70,5): error MSB3073: The command ““C:\Program Files\Epic Games\UE_5.6\Engine\Build\BatchFiles\Build.bat” AdventureGameEditor Win64 Development -Project=“C:\Users\USER\Documents\Unreal Projects\AdventureGame\AdventureGame.uproject” -WaitMutex -FromMsBuild -architecture=x64 -WorkingDir=C:\Users\USER\Documents\Unreal Projects\AdventureGame\Intermediate\ProjectFiles -Files=....\Source\AdventureGame\AdventureGameMode.cpp” exited with code 8.
1>Done building project “AdventureGame.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 4:26 PM and took 05.102 seconds ==========

should i be looking earlier in the output chain to find the issue?

EDIT: Okay so even though it gives me the 1 failed in the output when i launched Unreal from VS it worked, and i can change the text to whatever and compile and it works, so i guess my main concern now is the 1 failed and Done building project “AdventureGame.vcxproj” – FAILED. It works for now with the a simple Hello World code but not sure why it would work if it FAILED lol.

This doesn’t fix the problem, but in the Error List window at the top change the “Build+Intellisense” dropdown to “Build” so you don’t see errors from intellisense

1 Like

thanks I’ll make sure to do that, I fixed my nullptr typo and it still gave me,

1>Result: Failed (RulesError)
1>Total execution time: 4.55 seconds
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(70,5): error MSB3073: The command ““C:\Program Files\Epic Games\UE_5.6\Engine\Build\BatchFiles\Build.bat” AdventureGameEditor Win64 Development -Project=“C:\Users\USER\Documents\Unreal Projects\AdventureGame\AdventureGame.uproject” -WaitMutex -FromMsBuild -architecture=x64 -WorkingDir=C:\Users\USER\Documents\Unreal Projects\AdventureGame\Intermediate\ProjectFiles -Files=…\Source\AdventureGame\AdventureGameMode.cpp” exited with code 8.
1>Done building project “AdventureGame.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 4:26 PM and took 05.102 seconds ==========

in the output after a compile but it works and i can change the text to whatever and compile and it works now as well i guess im just confused how it works with 1 failed during the compile process and the Done building project “AdventureGame.vcxproj” – FAILED. i know for this specific tut you have to go into the engine .ini of your project delete the 2 lines under

+ActiveGameNameRedirects=(OldGameName=“TP_FirstPersonBP”,NewGameName=“/Script/AdventureGame”)
+ActiveGameNameRedirects=(OldGameName=“/Script/TP_FirstPersonBP”,NewGameName=“/Script/AdventureGame”)

because the conflict makes it so you cant put your BP_AdventureGameMode as the game mode so i wonder if that has anything to do with it.