4.15 C++ Transition Guide

You can’t call methods across modules if they haven’t been explicitly exported, as is the case with those. If the person who wrote that engine code didn’t intend for them to be used externally, then there’s nothing you can do without modifying the engine.

A bunch of typedefs have disappeared from the Messaging module (and possibly other places as well), such as these:



/** Type definition for shared pointers to instances of IMessageBus. */
typedef TSharedPtr<IMessageBus, ESPMode::ThreadSafe> IMessageBusPtr;

/** Type definition for shared references to instances of IMessageBus. */
typedef TSharedRef<IMessageBus, ESPMode::ThreadSafe> IMessageBusRef;

/** Type definition for weak pointers to instances of IMessageBus. */
typedef TWeakPtr<IMessageBus, ESPMode::ThreadSafe> IMessageBusWeakPtr;


I’m not sure if this was intentional or a side-effect of the automated header include cleanup process, which was done to improve engine compile times.

I made use of these in a plugin I built for a customer some time ago, resulting in compiler errors after upgrading to 4.15. Fixing it was easy: just replace the type aliases in your code with the fully written out type names.

Ah, I remembered now, thanks! Will rebuild from source and export those functions explicitly.

For those who are using VS2017 and have uninstalled VS2015 (like me), there is actually a small number of changes to be made, given that VS2017 includes the VS2015 compiler installed. You get VS2017 IDE benefits, while being able to continue working on VS2015 projects.

Anyway, UE4 IntelliSense VSIX plugin for VS2015 is not compatible with VS2017. However, someone has volunteered to update the VSIX plugin to VS2017, but it is unstable (as so the forked dev claims). Here’s the post to UE4 IntelliSense for VS2017.

(I wondered if this warrants an entry to the 4.15 Transition Guide OP post?)

There is a lightweight solution for GEngine access. Include “Engine/Engine.h”
Engine/Engine.h is a “compact” header unlike huge “Engine/Public/Engine.h”

I have a project based on the Shooter Game sample that I’m trying to migrate from 4.14 to 4.15. When attempting a compile I get the error that FOnlineSessionSearchResult is undefined in *GameInstance.h. Assuming this was my fault I downloaded the 4.15 version of Shooter Game Sample, only to find that the issue is also present in that project.

Looking at the release notes, I see that there was a bugfix regarding session searching:

Since there was also apparently a change in the way headers are included, I suspect that some combination of these two bugfixes is the culprit.

Anyone know about this?

Have you changed your Build.cs project file with updated dependency?


PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore", "PhysXVehicles", "HeadMountedDisplay" });

Thank you! It’s help with “Vechicles errors”, but now I got new one in my OST_HUDElement.cpp:



ERROR	C2039	DrawTextW: is not a member of "AHUD"	        OST_Game		C:\Users\Anna\Documents\Unreal Projects\OST_Game\Source\OST_Game\OST_HUDElement.cpp	388			
ERROR	C2039	DrawTextW: is not a member of "AHUD"	        OST_Game		C:\Users\Anna\Documents\Unreal Projects\OST_Game\Source\OST_Game\OST_HUDElement.cpp	397			
ERROR	C2039	DrawTextW: is not a member of "AHUD"	        OST_Game		C:\Users\Anna\Documents\Unreal Projects\OST_Game\Source\OST_Game\OST_HUDElement.cpp	418			
ERROR	C2039	DrawTextW: is not a member of "AOST_HUD"	OST_Game		C:\Users\Anna\Documents\Unreal Projects\OST_Game\Source\OST_Game\OST_HUDElement.cpp	216			
ERROR	C2039	DrawTextW: is not a member of "AOST_HUD"	OST_Game		C:\Users\Anna\Documents\Unreal Projects\OST_Game\Source\OST_Game\OST_HUDElement.cpp	217	

It’s possible to fix it somehow?

Clean the solution and compile?

I cleaned solution and compile, and get this errors.

HI,
after updating from 4.14.3 to 4.15.1 I encountered several errors. After fixing all the ones mentioned in this thread I know get a lot of
unresolved external symbol errors. All the errors are for new components which I wrote in C++.
The same code is compiling fine with 4.14.3. Does this has anything to do with the new include system?
Anybody experiencing the same problem?
Cheers

We tried transitioning over, but are getting the following build error:

Severity Code Description Project File Line Suppression State
Error System.Exception: Could not find token at index 331 RavenValidated C:\Users\Nordictiger\Documents\Unreal Projects\RavenValidated\Intermediate\ProjectFiles\EXEC 1

Anyone know where we should start?

Got it. In our game the player is allowed to switch into different characters, so we had a folder named switch, which seemed not to be allowed anymore. After renaming it to switching everything works fine :slight_smile:

I noticed the PathFollow plugin problem with source build. It looks like the plugin does not support new IWYU rules.

After migrating from 4.14 to 4.15 I get this error


 error : Missing ';' before 'friend'

It takes me to a structure I have in a static class here:


friend FArchive& operator<<(FArchive& Ar, F3DARY& V)
{
	return Ar << V.row << V.faces << V.numVerts;
}

This code works on 4.14 and the only guess I have right now is that it’s related to this IWYU setup. Any ideas what I would need to include to get this working? I’ve tried including serialization/Archive.h but that doesn’t work. I’m really confused about how this new setup works. How does it effect my game project, is it only effecting plugins I’m including?

Yeah, endless errors transitioning from 4.14 to 4.15. Its like a ton of changes were not disclosed that drastically change how things are read/compiled. Whether its disabling IWYU or making the Header changes, it only reveals additional errors undisclosed in documentation.

Can’t post actual code here but here are some errors


I tried to give that another try (I did the compiling in the project back when 4.15 was just release), thought it was going to compile, then it gave off some new errors, this time in DialogueViewport. The thing is, in 4.14, I compiled your plugin in the Engine just fine. Something drastically changed with how the Engine is compiling the code and I just don't know what it is. Disabling the IWYU in the plugin just bypasses the header issues. This plugin and ImageResizUEr seem to have problems with compiling in a custom engine, even if its a release build straight from UnrealEngine's Github. How are you compiling the plugin? Is it completely made in the Project or are you working with a custom engine build yourself?



Severity Code Description Project File Line Suppression State
Error C2227 left of ‘->BackwardSplineTangentFromVerticalDelta’ must point to class/struct/union/generic type MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1524
Error C2065 ‘UGraphEditorSettings’: undeclared identifier MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1515
Error C2672 ‘GetDefault’: no matching overloaded function found MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1515
Error C2974 ‘GetDefault’: invalid template argument for ‘T’, type expected MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1515
Error C2227 left of ‘->ForwardSplineHorizontalDeltaRange’ must point to class/struct/union/generic type MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1515
Error C2227 left of ‘->BackwardSplineHorizontalDeltaRange’ must point to class/struct/union/generic type MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1515
Error C2664 ‘T FGenericPlatformMath::Min(const TArray<float,FDefaultAllocator> &,int32 *)’: cannot convert argument 1 from ‘float’ to ‘const TArray<float,FDefaultAllocator> &’ MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1515
Error C2789 ‘ClampedTensionX’: an object of const-qualified type must be initialized MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1515
Error C2065 ‘UGraphEditorSettings’: undeclared identifier MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1516
Error C2672 ‘GetDefault’: no matching overloaded function found MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1516
Error C2974 ‘GetDefault’: invalid template argument for ‘T’, type expected MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1516
Error C2227 left of ‘->ForwardSplineVerticalDeltaRange’ must point to class/struct/union/generic type MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1516
Error C2227 left of ‘->BackwardSplineVerticalDeltaRange’ must point to class/struct/union/generic type MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1516
Error C2664 ‘T FGenericPlatformMath::Min(const TArray<float,FDefaultAllocator> &,int32 *)’: cannot convert argument 1 from ‘float’ to ‘const TArray<float,FDefaultAllocator> &’ MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1516
Error C2789 ‘ClampedTensionY’: an object of const-qualified type must be initialized MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1516
Error C2065 ‘UGraphEditorSettings’: undeclared identifier MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1520
Error C2672 ‘GetDefault’: no matching overloaded function found MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1520
Error C2974 ‘GetDefault’: invalid template argument for ‘T’, type expected MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1520
Error C2227 left of ‘->ForwardSplineTangentFromVerticalDelta’ must point to class/struct/union/generic type MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1520
Error C2065 ‘UGraphEditorSettings’: undeclared identifier MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1524
Error C2672 ‘GetDefault’: no matching overloaded function found MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1524
Error C2974 ‘GetDefault’: invalid template argument for ‘T’, type expected MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1524
Error C2227 left of ‘->BackwardSplineTangentFromHorizontalDelta’ must point to class/struct/union/generic type MyProject3 \Source\DialoguePluginEditor\Private\DialogueViewportWidget.cpp 1524




Hi All,

So when I create a C++ project for 4.14 and below–everything works. However, when I create a project with 4.15, I get this error:
The project could not be compiled. Would you like to open it in Visual Studio?

Running G:/Unreal Projects/UE_4.15/Engine/Binaries/DotNET/UnrealBuildTool.exe Test Development Win64 -project=“G:/Unreal Projects/FPSCplusplus/Test/Test.uproject” -editorrecompile -progress -NoHotReloadFromIDE
Performing full C++ include scan (building a new target)
ERROR: System.NotSupportedException: The given path’s format is not supported.
at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
at UnrealBuildTool.UnrealBuildTool.LoadUBTMakefile(FileReference MakefilePath, FileReference ProjectFile, String& ReasonNotLoaded)
at UnrealBuildTool.UnrealBuildTool.RunUBT(String] Arguments, FileReference ProjectFile)

I changed from 4.14 to 4.15 and I get these errors.
What should I do?

It looks like you are directly including Windows.h, which is conflicting with some of our internal macros and redefining some function names as macros. Trying including WindowsHWrapper.h instead, which undefines and redefines those macros first (via PreWindowsApi.h and PostWindowsApi.h).

There are two errors.

  1. fatal error C1083: Cannot open include file: ‘Components/SlateWrapperTypes.h’: No such file or directory
    OR
  2. fatal error C1083: Cannot open include file: ‘Interfaces/ITargetDevice.h’: No such file or directory
    How should I handle it?