C++ Transition Guide for 4.18

Finally got my project compiling on 4.18 but it crashes at 93% before it opens.

Output log




[2017.12.03-12.09.02:296] 0]LogWindows: Windows GetLastError: The operation completed successfully. (0)
[2017.12.03-12.09.02:297] 0]LogWindows: Error: === Critical error: ===
[2017.12.03-12.09.02:297] 0]LogWindows: Error:
[2017.12.03-12.09.02:297] 0]LogWindows: Error: Assertion failed: !F->GetSuperFunction() || (F->GetSuperFunction()->FunctionFlags&FUNC_NetFuncFlags) == (F->FunctionFlags&FUNC_NetFuncFlags) [File:D:\UnrealEngines\4.18\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp] [Line: 3068]
[2017.12.03-12.09.02:297] 0]LogWindows: Error:
[2017.12.03-12.09.02:297] 0]LogWindows: Error:
[2017.12.03-12.09.02:297] 0]LogWindows: Error:
[2017.12.03-12.09.02:297] 0]LogWindows: Error:
The thread 0x7f58 has exited with code 0 (0x0).
[2017.12.03-12.09.02:311] 0]LogExit: Executing StaticShutdownAfterError
[2017.12.03-12.09.02:314] 0]LogWindows: FPlatformMisc::RequestExit(1)



Does this call stack make sense to anyone?

2nd break, continuing causes crash



>    UE4Editor-ApplicationCore.dll!FWindowsErrorOutputDevice::Serialize(const wchar_t * Msg, ELogVerbosity::Type Verbosity, const FName & Category) Line 31    C++
     UE4Editor-Core.dll!FOutputDevice::Logf__VA(const wchar_t * Fmt, ...) Line 70    C++
     UE4Editor-Core.dll!FDebug::AssertFailed(const char * Expr, const char * File, int Line, const wchar_t * Format, ...) Line 414    C++
     UE4Editor-CoreUObject.dll!UClass::Link(FArchive & Ar, bool bRelinkExistingProperties) Line 3069    C++
     UE4Editor-Engine.dll!UBlueprintGeneratedClass::Link(FArchive & Ar, bool bRelinkExistingProperties) Line 1367    C++
     UE4Editor-CoreUObject.dll!UClass::Serialize(FArchive & Ar) Line 3531    C++
     UE4Editor-Engine.dll!UBlueprintGeneratedClass::Serialize(FArchive & Ar) Line 1460    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::Preload(UObject * Object) Line 3300    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::CreateExport(int Index) Line 4018    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::IndexToObject(FPackageIndex Index) Line 4241    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::CreateExport(int Index) Line 3711    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::CreateExportAndPreload(int ExportIndex, bool bForcePreload) Line 2744    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::LoadAllObjects(bool bForcePreload) Line 2902    C++
     UE4Editor-CoreUObject.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageNameOrFilename, unsigned int LoadFlags, FLinkerLoad * ImportLinker) Line 1322    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2421    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::VerifyImport(int ImportIndex) Line 2177    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2469    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::VerifyImport(int ImportIndex) Line 2177    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::Verify() Line 1956    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::FinalizeCreation() Line 1866    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::Tick(float InTimeLimit, bool bInUseTimeLimit, bool bInUseFullTimeLimit) Line 735    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::CreateLinker(UPackage * Parent, const wchar_t * Filename, unsigned int LoadFlags) Line 438    C++
     UE4Editor-CoreUObject.dll!GetPackageLinker(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags, UPackageMap * Sandbox, FGuid * CompatibleGuid) Line 690    C++
     UE4Editor-CoreUObject.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageNameOrFilename, unsigned int LoadFlags, FLinkerLoad * ImportLinker) Line 1234    C++
     UE4Editor-CoreUObject.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 1430    C++
     UE4Editor-UnrealEd.dll!UEditorEngine::Map_Load(const wchar_t * Str, FOutputDevice & Ar) Line 2492    C++
     UE4Editor-UnrealEd.dll!UEditorEngine::HandleMapCommand(const wchar_t * Str, FOutputDevice & Ar, UWorld * InWorld) Line 5968    C++
     UE4Editor-UnrealEd.dll!UEditorEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 5445    C++
     UE4Editor-UnrealEd.dll!UUnrealEdEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 672    C++
     UE4Editor-UnrealEd.dll!FEditorFileUtils::LoadMap(const FString & InFilename, bool LoadAsTemplate, const bool bShowProgress) Line 2229    C++
     UE4Editor-UnrealEd.dll!FEditorFileUtils::LoadDefaultMapAtStartup() Line 3477    C++
     UE4Editor-UnrealEd.dll!FUnrealEdMisc::OnInit() Line 348    C++
     UE4Editor-UnrealEd.dll!EditorInit(IEngineLoop & EngineLoop) Line 97    C++
     UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 150    C++
     UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 199    C++
     UE4Editor.exe!__scrt_common_main_seh() Line 253    C++
     kernel32.dll!00007ffd4c882774()    Unknown
     ntdll.dll!00007ffd4cac0d51()    Unknown



1st break point



>    UE4Editor-CoreUObject.dll!UClass::Link(FArchive & Ar, bool bRelinkExistingProperties) Line 3068    C++
     UE4Editor-Engine.dll!UBlueprintGeneratedClass::Link(FArchive & Ar, bool bRelinkExistingProperties) Line 1367    C++
     UE4Editor-CoreUObject.dll!UClass::Serialize(FArchive & Ar) Line 3531    C++
     UE4Editor-Engine.dll!UBlueprintGeneratedClass::Serialize(FArchive & Ar) Line 1460    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::Preload(UObject * Object) Line 3300    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::CreateExport(int Index) Line 4018    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::IndexToObject(FPackageIndex Index) Line 4241    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::CreateExport(int Index) Line 3711    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::CreateExportAndPreload(int ExportIndex, bool bForcePreload) Line 2744    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::LoadAllObjects(bool bForcePreload) Line 2902    C++
     UE4Editor-CoreUObject.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageNameOrFilename, unsigned int LoadFlags, FLinkerLoad * ImportLinker) Line 1322    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2421    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::VerifyImport(int ImportIndex) Line 2177    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2469    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::VerifyImport(int ImportIndex) Line 2177    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::Verify() Line 1956    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::FinalizeCreation() Line 1866    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::Tick(float InTimeLimit, bool bInUseTimeLimit, bool bInUseFullTimeLimit) Line 735    C++
     UE4Editor-CoreUObject.dll!FLinkerLoad::CreateLinker(UPackage * Parent, const wchar_t * Filename, unsigned int LoadFlags) Line 438    C++
     UE4Editor-CoreUObject.dll!GetPackageLinker(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags, UPackageMap * Sandbox, FGuid * CompatibleGuid) Line 690    C++
     UE4Editor-CoreUObject.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageNameOrFilename, unsigned int LoadFlags, FLinkerLoad * ImportLinker) Line 1234    C++
     UE4Editor-CoreUObject.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 1430    C++
     UE4Editor-UnrealEd.dll!UEditorEngine::Map_Load(const wchar_t * Str, FOutputDevice & Ar) Line 2492    C++
     UE4Editor-UnrealEd.dll!UEditorEngine::HandleMapCommand(const wchar_t * Str, FOutputDevice & Ar, UWorld * InWorld) Line 5968    C++
     UE4Editor-UnrealEd.dll!UEditorEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 5445    C++
     UE4Editor-UnrealEd.dll!UUnrealEdEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 672    C++
     UE4Editor-UnrealEd.dll!FEditorFileUtils::LoadMap(const FString & InFilename, bool LoadAsTemplate, const bool bShowProgress) Line 2229    C++
     UE4Editor-UnrealEd.dll!FEditorFileUtils::LoadDefaultMapAtStartup() Line 3477    C++
     UE4Editor-UnrealEd.dll!FUnrealEdMisc::OnInit() Line 348    C++
     UE4Editor-UnrealEd.dll!EditorInit(IEngineLoop & EngineLoop) Line 97    C++
     UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 150    C++
     UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 199    C++
     UE4Editor.exe!__scrt_common_main_seh() Line 253    C++
     kernel32.dll!00007ffd4c882774()    Unknown
     ntdll.dll!00007ffd4cac0d51()    Unknown



I really can’t make heads or tail of that.

Once again, the ARRAY_COUNT conflict with steam rears its ugly head. This will cause weird syntax errors unless you change every instance of ARRAY_COUNT in the engine’s steamworks code to something unique like STEAM_ARRAY_COUNT

You have some blueprint that is failing to compile. Unfortunately I can’t tell anything else. You’ll need to either remove Blueprints one by one till you find the offender, or catch that assert in the debugger and inspect the callstack/variables for what Blueprint is blowing up and why.

Can’t move on 4.18 from 4.16 because of error, can someone help please?=(
UnrealHeaderTool failed for target ‘OST_GameEditor’ (platform: Win64, module info: C:\UE4\OST_Game\Intermediate\Build\Win64\OST_GameEditor\Development\OST_GameEditor.uhtmanifest, exit code: OtherCompilationError (5)).

Post the rest of the log, that one line doesn’t tell me anything.

UnrealHeaderTool failed for target ‘OST_GameEditor’ (platform: Win64, module info: C:\UE4\OST_Game\Intermediate\Build\Win64\OST_GameEditor\Development\OST_GameEditor.uhtmanifest, exit code: OtherCompilationError (5)).
Error MSB3075 The command ““Z:\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat” OST_GameEditor Win64 Development “C:\UE4\OST_Game\OST_Game.uproject” -waitmutex” exited with code 5. Убедитесь в наличии достаточных прав для выполнения данной команды. OST_Game 1 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets
http://i.imgur.com/tRPXmCqs.png

You normally only get that error for one of two reasons:

  • You actually have a compile error somewhere so UHT can’t execute (in which case you should see more info in the output tab in Visual Studio).
  • It completely failed to run the UHT (which could be a windows permission issue, or you forgot to build the Engine/Install it properly).

Thank you! It’s help)

Guys, I used to check



if ( UEBuildConfiguration.bWithServerCode ) { ... }


inside a Build file for a project; but apparently “UEBuildConfiguration” is deprecated on 4.18 and I have no idea where to check for “bWithServerCode” within a Build.cs file now.
Anybody have ideas about this??

Should be just part of the “Target” passed in. So, if ( Target.bWithServerCode ) …

[FONT=“Helvetica Neue”]Since version 4.18 there is an exception in “Client game mode” only. Not in Editor mode.

  • template< typename ShaderRHIParamRef, typename TRHICmdList >
  • void FSceneTextureShaderParameters::Set(
  •  TRHICmdList& RHICmdList,
    
  •  const ShaderRHIParamRef& ShaderRHI,
    
  •  const FSceneView& View,
    
  •  const EDeferredParamStrictness ParamStrictness,
    
  •  ESceneRenderTargetsMode::Type TextureMode,
    
  •  ESamplerFilter ColorFilter ) const
    
  • {
  •  FTextureRHIParamRef BlackDefault2D = GSystemTextures.BlackDummy-&gt;GetRenderTargetItem().ShaderResourceTexture;
    
  •  FTextureRHIParamRef DepthDefault = GSystemTextures.DepthDummy-&gt;GetRenderTargetItem().ShaderResourceTexture;
    

Since BlackDummy and DepthDummy are null an exception occurred.

In “Editor mode” the GSystemTextures.InitializeTextures(RHICmdList, FeatureLevel);.
is called and initialize the member vars.

Why not in “Client mode” ?

I had same issue and found, that it is data race in pak file async read code. My patch is:



             if (Block.RefCount > 0)
             {
                 check(&Block == Blocks[Block.BlockIndex] && !Block.bCancelledBlock);
+                TArray<FPakProcessedReadRequest*> CompletedRequests;
+                CompletedRequests.Reserve(LiveRequests.Num());
                 for (FPakProcessedReadRequest* Req : LiveRequests)
                 {
                     if (Req->CheckCompletion(*FileEntry, Block.BlockIndex, Blocks))
                     {
-                        Req->RequestIsComplete();
+                        // Fix data race
+                        CompletedRequests.Add(Req);
                     }
                 }
+
+                // Callbacks can add or remove requests, so we must be sure, that we don't iterate them at same time
+                for (auto* Req : CompletedRequests)
+                {
+                    Req->RequestIsComplete();
+                }
+
                 Block.bCPUWorkIsComplete = true;
             }


in file Engine/Source/Runtime/PakFile/Private/IPlatformFilePak.cpp

Also you can take similar fix from epics from engine master branch (found it later).

So upgrading from 4.14.3 to 4.18.3 we hit an issue from upgrading the Advanced Sessions plugin, other plugins may also cause this issue. The problem is when a node changes and its execution pins have a different name to what they previously did, it doesn’t seem to like this so the engine crashes in EdGraphNode.cpp::203



UEdGraphPin* UEdGraphNode::FindPinChecked(const FString& PinName, const EEdGraphPinDirection Direction) const
{
    UEdGraphPin* Result = FindPin(PinName, Direction);
    check(Result != NULL); //This line
    return Result;
}


If you do get this problem, make sure you launch the editor through visual studio then jump up the call stack to FKismetCompilerContext::CreateAndProcessUbergraph() 3094 and look at the debug data for ConsolidatedEventGraph, that should tell you which blueprint is causing the issue, once you have this comment out the offending line above to get the editor to open so you can fix your blueprint then uncomment it again just incase you have any issues in the future.

For the record, this doesn’t appear to be the plugins fault which is why i’m posting this here, the cause is just whenever any async blueprint nodes change the names of their execution pins causes this to happen.

100% total newb here, so sorry if this isn’t the place for this. Every google search I type sends me here.

I’m trying to learn C++ with Unreal 4.18. I’m trying to use the Unreal tutorials but none of the code ever works. I keep getting errors messages I don’t understand and my code is exactly the same as what is in the tutorials. Can anyone point me in the right direction here? I’m getting frustrated and just want to learn.

You have to post problematic error along with errors. And people will help you. Only remember to use a separate thread for that.

And… always try to search for forum/AnswerHub threads before posting. Tens and hundreds of guys had the same basic C++ problems and already asked questions. I learned Unreal C++ mostly by reading old discussions.

Good luck! :slight_smile:

You have to use the same engine version the tutorial was using.
Unreal Engine changes every time, all the time. Specially on C++ side of things.

A Marketplace asset that I used before UE4 4.18 worked fine. Now, a lot of it is broken. As it uses C++ for new BP nodes, I’m suspecting that the code changes in the engine is the culprit.

How can I find the C++ code, build it and find what lines don’t work? I’m completely confused on how to even begin fixing this issue.

Any help would be appreciated.

Hey just wondering is anyone else having trouble using the UPROPERTY(EditAnywhere) to get anything to show up in the defaults tab, iv been trying to get a UBehaviorTree class to show up there for about 2 hours now but i cant seem to get anything to show im not to sure is this a bug or what so i just wanted to know if anyone else has experienced this and if so did you managed to fix it