# C++ Transition Guide for 4.18

**URL:** <https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [October 24, 2017, 9:29pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714 "2017-10-24T21:29:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [October 24, 2017, 9:29pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/1 "2017-10-24T21:29:20Z")

</div>

Dear Community,

Cheers and fireworks for 4.18! Yay!

Here is a thread where you can post your research & solutions as you are upgrading to 4.18.

Questions are welcome here about C++, as well as any other editor-related aspects of 4.18 that you think might be common issues.

Have fun upgrading!

❤

Rama

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [October 24, 2017, 10:33pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/2 "2017-10-24T22:33:40Z")

</div>

**Can’t Make VS Files For Your Project?**

**The New Target.cs**

Are you finding you can’t generate VS files for your project?

Beginning with 4.18 you must use the new target.cs setup

old:

```auto

public class PMeleeWeaponTarget : TargetRules
{
    public PMeleeWeaponTarget(TargetInfo Target)
    {
        Type = TargetType.Game;
    }

    public override void SetupBinaries(
        TargetInfo Target,
        ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
        ref List<string> OutExtraModuleNames
        )
    {
        OutExtraModuleNames.AddRange( new string] { "PMeleeWeapon" } );
    }
}

```

**New:**

```auto

public class PMeleeWeaponTarget : TargetRules
{
    public PMeleeWeaponTarget(TargetInfo Target)
        : base(Target)
    {
        Type = TargetType.Game;
        ExtraModuleNames.Add("PMeleeWeapon");
    }
}

```

Editor Old

```auto

public class PMeleeWeaponEditorTarget : TargetRules
{
    public PMeleeWeaponEditorTarget(TargetInfo Target)
    {
        Type = TargetType.Editor;
    }

    //
    // TargetRules interface.
    //

    public override void SetupBinaries(
        TargetInfo Target,
        ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
        ref List<string> OutExtraModuleNames
        )
    {
        OutExtraModuleNames.AddRange( new string] { "PMeleeWeapon" } );
    }
}

```

**Editor New**

```auto

public class PMeleeWeaponEditorTarget : TargetRules
{
    public PMeleeWeaponEditorTarget(TargetInfo Target)
        : base(Target)
    {
        Type = TargetType.Editor;
        ExtraModuleNames.Add("PMeleeWeapon");
    }
}

```

❤

Rama

---

<div class="post-metadata">

**Author:** ![User-970075953](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@User-970075953](https://forums.unrealengine.com/u/User-970075953)\
**Post date:** [October 25, 2017, 9:41am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/3 "2017-10-25T09:41:35Z")

</div>

The HMD device location has changed - but it’s a pretty simple fix up:  
Previously if you did:

```auto

EHMDDeviceType::Type device = GEngine->HMDDevice.Get()

```

You now do:

```auto

EHMDDeviceType::Type device = GEngine->XRSystem->GetHMDDevice()

```

and #include “IXRTrackingSystem.h”

And it should all work as before.

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [October 25, 2017, 7:32pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/4 "2017-10-25T19:32:30Z")

</div>

Got this one:

> [@](#):
>
> ‘UPrimitiveComponent::GetPhysicsAngularVelocity’: Use GetPhysicsAngularVelocityInDegrees instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.

And this:

> [@](#):
>
> fatal error C1083: Cannot open include file: ‘Interfaces/IImageWrapper.h’: No such file or directory  
> fatal error C1083: Cannot open include file: ‘Interfaces/IImageWrapperModule.h’: No such file or directory

Both was moved to a public folder:

```auto

#include "IImageWrapper.h"
#include "IImageWrapperModule.h"

```

---

<div class="post-metadata">

**Author:** ![Devero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Devero](https://forums.unrealengine.com/u/Devero)\
**Post date:** [October 25, 2017, 8:34pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/5 "2017-10-25T20:34:58Z")

</div>

Hi guys,

Anyone else getting compile errors on a vanilla github 4.18 source compile? I"m getting these errors and seem to be in the engine side:

GitEngines\UnrealEngine\_4.18.0\Engine\Source\Programs\Mac\ShaderCacheTool\Private\ShaderCacheTool.cpp(66): error C2039: ‘MergeShaderCacheFiles’: is not a member of ‘FShaderCache’

… and…

GitEngines\UnrealEngine\_4.18.0\Engine\Source\Programs\BuildPatchTool\Private\ToolModes\AutomationMode.cpp(12): fatal error C1083: Cannot open include file: ‘Interfaces/IAutomationWorkerModule.h’: No such file or directory

---

<div class="post-metadata">

**Author:** ![Dark583](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dark583](https://forums.unrealengine.com/u/Dark583)\
**Post date:** [October 25, 2017, 10:58pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/6 "2017-10-25T22:58:04Z")

</div>

How do i properly relink the Destruction Apex Class since they moved it to be a plugin? [https://i.gyazo.com/3d691d86ff09b038640c880a12836ee9.png](https://i.gyazo.com/3d691d86ff09b038640c880a12836ee9.png)

---

<div class="post-metadata">

**Author:** ![kevterm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kevterm](https://forums.unrealengine.com/u/kevterm)\
**Post date:** [October 26, 2017, 4:44am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/7 "2017-10-26T04:44:15Z")

</div>

Are the DPI related functions (e.g. FGenericPlatformMisc::ConvertInchesToPixels) gone in 4.18? Is there a new way for calculating DPI? Thank you.

---

<div class="post-metadata">

**Author:** ![Zoc](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zoc/32/88714_2.png) [@Zoc](https://forums.unrealengine.com/u/Zoc)\
**Post date:** [October 26, 2017, 5:28am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/8 "2017-10-26T05:28:43Z")

</div>

One of the [FONT=courier new]FTimespan() constructors changed signature from

```auto

FTimespan(int32 Days, int32 Hours, int32 Minutes, int32 Seconds, int32 Milliseconds, int32 Microseconds = 0)

```

to

```auto

FTimespan(int32 Days, int32 Hours, int32 Minutes, int32 Seconds, int32 FractionNano)

```

The easiest way to fix this is use one of the built in static functions (In my case, I used [FONT=courier new]FTimespan::FromSeconds(DeltaTime) )

–

[FONT=courier new]FBodyInstance functions [FONT=courier new]SetAngularVelocity() and [FONT=courier new]GetUnrealWorldAngularVelocity() are now deprecated  
To fix, use their [FONT=courier new]SetAngularVelocityInRadians() and [FONT=courier new]GetUnrealWorldAngularVelocityInRadians() variants instead. Don’t forget to call [FONT=courier new]FMath:: DegreesToRadians() where needed!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [October 30, 2017, 4:31am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/9 "2017-10-30T04:31:49Z")

</div>

> [@Dark583](#):
>
> How do i properly relink the Destruction Apex Class since they moved it to be a plugin? [https://i.gyazo.com/3d691d86ff09b038640c880a12836ee9.png](https://i.gyazo.com/3d691d86ff09b038640c880a12836ee9.png)

Add to your .uproject or your .uplugin:

```auto

"Plugins" :
    
        {
            "Name": "ApexDestruction",
            "Enabled": true
        } 
    ]    

```

❤

Rama

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [October 30, 2017, 4:32am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/10 "2017-10-30T04:32:34Z")

</div>

> [@Devero](#):
>
> Hi guys,
> 
> Anyone else getting compile errors on a vanilla github 4.18 source compile? I"m getting these errors and seem to be in the engine side:
> 
> GitEngines\UnrealEngine\_4.18.0\Engine\Source\Programs\Mac\ShaderCacheTool\Private\ShaderCacheTool.cpp(66): error C2039: ‘MergeShaderCacheFiles’: is not a member of ‘FShaderCache’
> 
> … and…
> 
> GitEngines\UnrealEngine\_4.18.0\Engine\Source\Programs\BuildPatchTool\Private\ToolModes\AutomationMode.cpp(12): fatal error C1083: Cannot open include file: ‘Interfaces/IAutomationWorkerModule.h’: No such file or directory

Hi Devero!!!

Did this ever get resolved?

🙂

Rama

---

<div class="post-metadata">

**Author:** ![SolidGasStudios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidgasstudios/32/1194575_2.png) [@SolidGasStudios](https://forums.unrealengine.com/u/SolidGasStudios)\
**Post date:** [October 30, 2017, 8:41am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/11 "2017-10-30T08:41:43Z")

</div>

> [@Devero](#):
>
> Hi guys,
> 
> Anyone else getting compile errors on a vanilla github 4.18 source compile? I"m getting these errors and seem to be in the engine side:
> 
> GitEngines\UnrealEngine\_4.18.0\Engine\Source\Programs\Mac\ShaderCacheTool\Private\ShaderCacheTool.cpp(66): error C2039: ‘MergeShaderCacheFiles’: is not a member of ‘FShaderCache’
> 
> … and…
> 
> GitEngines\UnrealEngine\_4.18.0\Engine\Source\Programs\BuildPatchTool\Private\ToolModes\AutomationMode.cpp(12): fatal error C1083: Cannot open include file: ‘Interfaces/IAutomationWorkerModule.h’: No such file or directory

Remove the ShaderCacheTool project from your solution.

For ‘Interfaces/IAutomationWorkerModule.h’ remove the ‘Interfaces/’ portion.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4c6380f9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4c6380f9](https://forums.unrealengine.com/u/anonymous_user_4c6380f9)\
**Post date:** [October 31, 2017, 1:03pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/14 "2017-10-31T13:03:47Z")

</div>

I noticed that the module containing FGamepadKeyNames has been changed from Core to ApplicationCore.

```auto

struct **CORE_API** FGamepadKeyNames
{
    typedef FName Type;
...

struct **APPLICATIONCORE_API** FGamepadKeyNames
{
    typedef FName Type;
...

```

---

<div class="post-metadata">

**Author:** ![Altrue](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/altrue/32/1186768_2.png) [@Altrue](https://forums.unrealengine.com/u/Altrue)\
**Post date:** [October 31, 2017, 10:04pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/16 "2017-10-31T22:04:13Z")

</div>

Since updating to 4.18, I am seeing this wierd non-fatal crash in the log my dedicated server and client on linux and windows:  
(Important bits in **underlined bold** )

```auto

[2017.10.31-21.55.14:751] 0]LogPakFile: New pak file ../../../ProjectName/Content/Paks/ProjectName-WindowsNoEditor.pak added to pak precacher.
[2017.10.31-21.55.15:023] 0]LogStats: FPlatformStackWalk::StackWalkAndDump - 0.164 s
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: === Handled ensure: ===
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error:
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: Ensure condition failed: Lhs.Array.Num() == Lhs.InitialNum [File:c:\users\altrue\documents\unrealengine\engine\source\runtime\core\public\Containers/SparseArray.h] [Line: 781]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: **Container has changed during ranged-for iteration!**
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: Stack:
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x0000000040271766 ProjectName.exe!FWindowsPlatformStackWalk::StackWalkAndDump() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:200]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x00000000400106C1 ProjectName.exe!FDebug::EnsureFailed() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\misc\assertionmacros.cpp:299]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000004002AA06 ProjectName.exe!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\misc\assertionmacros.cpp:425]
**[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x0000000042DCC415 ProjectName.exe!FPakAsyncReadFileHandle::DoProcessing() [c:\users\altrue\documents\unrealengine\engine\source\runtime\pakfile\private\iplatformfilepak.cpp:3218]**
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x0000000042DCED96 ProjectName.exe!TGraphTask<FAsyncIOCPUWorkTask>::ExecuteTask() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\public\async	askgraphinterfaces.h:787]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000003FEE5D15 ProjectName.exe!FTaskThreadAnyThread::ProcessTasks() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\async	askgraph.cpp:910]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000003FEE6F8D ProjectName.exe!FTaskThreadAnyThread::ProcessTasksUntilQuit() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\async	askgraph.cpp:786]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000003FEF5455 ProjectName.exe!FTaskThreadBase::Run() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\async	askgraph.cpp:502]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000004026F41C ProjectName.exe!FRunnableThreadWin::Run() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:76]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000004025FF63 ProjectName.exe!FRunnableThreadWin::GuardedRun() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:33]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x00000000771959CD kernel32.dll!UnknownFunction ]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x00000000773CA561 ntdll.dll!UnknownFunction ]
[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error:

```

The game still runs but it’s quite ugly to systematically have a stacktrace at the beginning of your logs. Besides, it’s just broken code waiting to happen…  
Any ideas?

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [November 1, 2017, 2:29pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/17 "2017-11-01T14:29:16Z")

</div>

> [@Altrue](#):
>
> Since updating to 4.18, I am seeing this wierd non-fatal crash in the log my dedicated server and client on linux and windows:  
> (Important bits in **underlined bold** )
> 
> ```auto
> 
> [2017.10.31-21.55.14:751] 0]LogPakFile: New pak file ../../../ProjectName/Content/Paks/ProjectName-WindowsNoEditor.pak added to pak precacher.
> [2017.10.31-21.55.15:023] 0]LogStats: FPlatformStackWalk::StackWalkAndDump - 0.164 s
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: === Handled ensure: ===
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error:
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: Ensure condition failed: Lhs.Array.Num() == Lhs.InitialNum [File:c:\users\altrue\documents\unrealengine\engine\source\runtime\core\public\Containers/SparseArray.h] [Line: 781]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: **Container has changed during ranged-for iteration!**
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: Stack:
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x0000000040271766 ProjectName.exe!FWindowsPlatformStackWalk::StackWalkAndDump() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:200]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x00000000400106C1 ProjectName.exe!FDebug::EnsureFailed() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\misc\assertionmacros.cpp:299]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000004002AA06 ProjectName.exe!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\misc\assertionmacros.cpp:425]
> **[2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x0000000042DCC415 ProjectName.exe!FPakAsyncReadFileHandle::DoProcessing() [c:\users\altrue\documents\unrealengine\engine\source\runtime\pakfile\private\iplatformfilepak.cpp:3218]**
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x0000000042DCED96 ProjectName.exe!TGraphTask<FAsyncIOCPUWorkTask>::ExecuteTask() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\public\async	askgraphinterfaces.h:787]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000003FEE5D15 ProjectName.exe!FTaskThreadAnyThread::ProcessTasks() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\async	askgraph.cpp:910]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000003FEE6F8D ProjectName.exe!FTaskThreadAnyThread::ProcessTasksUntilQuit() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\async	askgraph.cpp:786]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000003FEF5455 ProjectName.exe!FTaskThreadBase::Run() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\async	askgraph.cpp:502]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000004026F41C ProjectName.exe!FRunnableThreadWin::Run() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:76]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x000000004025FF63 ProjectName.exe!FRunnableThreadWin::GuardedRun() [c:\users\altrue\documents\unrealengine\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:33]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x00000000771959CD kernel32.dll!UnknownFunction ]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error: [Callstack] 0x00000000773CA561 ntdll.dll!UnknownFunction ]
> [2017.10.31-21.55.15:023] 0]LogOutputDevice: Error:
> 
> ```
> 
> The game still runs but it’s quite ugly to systematically have a stacktrace at the beginning of your logs. Besides, it’s just broken code waiting to happen..  
> Any ideas?

Somewhere in your code you are modifying an array while iterating through it which may cause pointer invalidation depending on the way you’re doing it:

> <https://stackoverflow.com/questions/16904454/what-is-iterator-invalidation>

---

<div class="post-metadata">

**Author:** ![Altrue](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/altrue/32/1186768_2.png) [@Altrue](https://forums.unrealengine.com/u/Altrue)\
**Post date:** [November 1, 2017, 4:01pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/18 "2017-11-01T16:01:25Z")

</div>

> [@BrUnO\_XaVIeR](#):
>
> Somewhere in your code you are modifying an array while iterating through it which may cause pointer invalidation depending on the way you’re doing it:
> 
> [https://stackoverflow.com/questions/16904454/what-is-iterator-invalidation](https://stackoverflow.com/questions/16904454/what-is-iterator-invalidation)

Yes, though it happens at the line 3218 of some pak processing code, which is in the engine code itself and not in my code.

Besides, both assertions containing this “\*\*Container has changed during ranged-for iteration!”\*\*text haven’t been modified between 4.17 and 4.18, leading me to believe that even if by some miracle the stacktrace was completely off, and my code was at fault, I would have seen this message in the 4.17 builds.

This seems a bit big for an engine bug though, I mean surely that kind of thing in the logs wouldn’t have passed QA. So I’m guessing this is a 4.17 -\> 4.18 transition thing, hence my posting here. Is there any modification to do regarding the way we handle paks or something?

---

<div class="post-metadata">

**Author:** ![imerovic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imerovic](https://forums.unrealengine.com/u/imerovic)\
**Post date:** [November 1, 2017, 6:14pm UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/19 "2017-11-01T18:14:01Z")

</div>

> [@Ninja\_K](#):
>
> I noticed an annoying 4.18 bug I think. I can’t join a dedicated server as a client from the command line anymore. It works when I do the exact same thing in 4.17 (with modifying the UE4 path of course). When I do it in 4.18, I just get a black screen. This is what I typed in command prompt.
> 
> “C:\Program Files\Epic Games\UE\_4.18\Engine\Binaries\Win64\UE4Editor.exe” “C:\UnrealProjects\Testing\Testing.uproject” -server -log
> 
> “C:\Program Files\Epic Games\UE\_4.18\Engine\Binaries\Win64\UE4Editor.exe” “C:\UnrealProjects\Testing\Testing.uproject” 192.168.2.21 -game -log
> 
> It says everything is connected in the log but I just get a black screen for the client window. What’s going on?

seems like in 4.18 you have to specify starting map, something like this:

“C:\Program Files\Epic Games\UE\_4.18\Engine\Binaries\Win64\UE4Editor.exe” “C:\UnrealProjects\Testing\Testing.uproject” /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap -server -log

---

<div class="post-metadata">

**Author:** ![Ninja\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ninja\_K](https://forums.unrealengine.com/u/Ninja_K)\
**Post date:** [November 2, 2017, 1:09am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/20 "2017-11-02T01:09:13Z")

</div>

> [@imerovic](#):
>
> seems like in 4.18 you have to specify starting map, something like this:
> 
> “C:\Program Files\Epic Games\UE\_4.18\Engine\Binaries\Win64\UE4Editor.exe” “C:\UnrealProjects\Testing\Testing.uproject” /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap -server -log

It’s working! Thx man, you’re the best!

---

<div class="post-metadata">

**Author:** ![Softavi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Softavi](https://forums.unrealengine.com/u/Softavi)\
**Post date:** [November 3, 2017, 9:52am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/21 "2017-11-03T09:52:04Z")

</div>

Hi,

My commandlet plugin crashes after upgrading from 4.17 to 4.18. It crashes inside UE after calling UPackage::SavePackage:

UPackage::SavePackage(AssetPackage, NULL, RF\_Standalone, \*PackageFileName, GError, nullptr, false, true, SAVE\_NoError)

Where,

- AssetPackage is the pointer to an UPackage returned by FindPackage.
- PackageFileName is the string returned by FPackageName::LongPackageNameToFilename.

The error I get is:

LogWindows: Error: Fatal error: [File:D:\Build++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 278]  
LogWindows: Error: Illegal call to StaticFindObject() while serializing object data!

Do you know what could have changed to cause the crash?

Thanks

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [November 3, 2017, 10:15am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/22 "2017-11-03T10:15:16Z")

</div>

> [@Devero](#):
>
> Hi guys,
> 
> Anyone else getting compile errors on a vanilla github 4.18 source compile? I"m getting these errors and seem to be in the engine side:
> 
> GitEngines\UnrealEngine\_4.18.0\Engine\Source\Programs\Mac\ShaderCacheTool\Private\ShaderCacheTool.cpp(66): error C2039: ‘MergeShaderCacheFiles’: is not a member of ‘FShaderCache’
> 
> … and…
> 
> GitEngines\UnrealEngine\_4.18.0\Engine\Source\Programs\BuildPatchTool\Private\ToolModes\AutomationMode.cpp(12): fatal error C1083: Cannot open include file: ‘Interfaces/IAutomationWorkerModule.h’: No such file or directory

Yes! I’m getting both of those! Did you manage to fix it?

---

<div class="post-metadata">

**Author:** ![Softavi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Softavi](https://forums.unrealengine.com/u/Softavi)\
**Post date:** [November 3, 2017, 10:30am UTC](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714/23 "2017-11-03T10:30:42Z")

</div>

> [@Softavi](#):
>
> Hi,
> 
> My commandlet plugin crashes after upgrading from 4.17 to 4.18. It crashes inside UE after calling UPackage::SavePackage:
> 
> UPackage::SavePackage(AssetPackage, NULL, RF\_Standalone, \*PackageFileName, GError, nullptr, false, true, SAVE\_NoError)
> 
> Where,
> 
> - AssetPackage is the pointer to an UPackage returned by FindPackage.
> - PackageFileName is the string returned by FPackageName::LongPackageNameToFilename.
> 
> The error I get is:
> 
> LogWindows: Error: Fatal error: [File:D:\Build++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 278]  
> LogWindows: Error: Illegal call to StaticFindObject() while serializing object data!
> 
> Do you know what could have changed to cause the crash?
> 
> Thanks

This is the full call stack:

LogWindows: Error: === Critical error: ===  
LogWindows: Error:  
LogWindows: Error: Fatal error: [File:D:\Build++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 278]  
LogWindows: Error: Illegal call to StaticFindObject() while serializing object data!  
LogWindows: Error:  
LogWindows: Error:  
LogWindows: Error: [Callstack] 0x00000000FD8AA06D KERNELBASE.dll!UnknownFunction ]  
LogWindows: Error: [Callstack] 0x00000000F38476D4 UE4Editor-ApplicationCore.dll!FWindowsErrorOutputDevice::Serialize() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\applicationcore\private\windows\windowserroroutputdevice.cpp:65]  
LogWindows: Error: [Callstack] 0x00000000DA8A2E0B UE4Editor-Core.dll!FOutputDevice::Logf\_\_VA() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:70]  
LogWindows: Error: [Callstack] 0x00000000DA8347D9 UE4Editor-Core.dll!FDebug::AssertFailed() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:414]  
LogWindows: Error: [Callstack] 0x00000000DA3E1CFC UE4Editor-CoreUObject.dll!StaticFindObject() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:281]  
LogWindows: Error: [Callstack] 0x00000000D872A448 UE4Editor-Engine.dll!UStaticMesh::GetAssetRegistryTags() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\staticmesh.cpp:1995]  
LogWindows: Error: [Callstack] 0x00000000DA37A352 UE4Editor-CoreUObject.dll!UPackage::SaveAssetRegistryData() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\savepackage.cpp:5635]  
LogWindows: Error: [Callstack] 0x00000000DA373D17 UE4Editor-CoreUObject.dll!UPackage::Save() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\savepackage.cpp:4616]  
LogWindows: Error: [Callstack] 0x00000000DA37A632 UE4Editor-CoreUObject.dll!UPackage::SavePackage() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\savepackage.cpp:5480]  
LogWindows: Error: [Callstack] 0x00000000BF0313E9 UE4Editor-CommandletPlugin.dll!UApplyMaterialsCommandlet::Main() [c: emp\commandletplugin\hostproject\plugins\commandletplugin\source\commandletplugin\private\commandlets\applymaterialscommandlet.cpp:250]  
LogWindows: Error: [Callstack] 0x000000003FF3D25F UE4Editor-Cmd.exe!FEngineLoop::PreInit() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2167]  
LogWindows: Error: [Callstack] 0x000000003FF3525A UE4Editor-Cmd.exe!GuardedMain() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launch.cpp:127]  
LogWindows: Error: [Callstack] 0x000000003FF354AA UE4Editor-Cmd.exe!GuardedMainWrapper() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]  
LogWindows: Error: [Callstack] 0x000000003FF42379 UE4Editor-Cmd.exe!WinMain() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]  
LogWindows: Error: [Callstack] 0x000000003FF43193 UE4Editor-Cmd.exe!\_\_scrt\_common\_main\_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe\_common.inl:253]  
LogWindows: Error: [Callstack] 0x00000000779759CD kernel32.dll!UnknownFunction ]  
LogWindows: Error: [Callstack] 0x0000000077BAA561 ntdll.dll!UnknownFunction ]  
ogWindows: Error: [Callstack] 0x0000000077BAA561 ntdll.dll!UnknownFunction ]

[Next page](https://forums.unrealengine.com/t/c-transition-guide-for-4-18/101714.md?page=2)
