C++ 4.16 Transition Guide

Upgrading my *Build.cs file in order to support ReadOnlyTargetRules parameter (eg. “MyModuleRules(ReadOnlyTargetRules Target) : base(Target)”) I have an error using



        UEBuildConfiguration.bForceEnableExceptions = true;


because ‘MyModuleRules’ now is read only… Where I can put my code in order to enable exceptions?

Simplifying to this helped. Thanks! If you create a new project you’ll also see this is the generated format.

If you have a problem to use steam on dedicated server, remove this code from /Engine/Plugins/Online/OnlineSubsystemSteam/Source/Private/OnlineSubsystemModuleSteam.cpp.
UE4 seems not to support steam on 64 bit yet. Game client is fine. But not dedicated server. It was disabled on 4.15.



void FOnlineSubsystemSteamModule::LoadSteamModules()
...
#if 0 //64 bit not supported well at present, use Steam Client dlls
	if (IsRunningDedicatedServer())
	{
		SteamServerDLLHandle = FPlatformProcess::GetDllHandle(*(RootSteamPath + "steamclient" + Suffix + ".dll"));
	}
#endif
...


Entry point not found - steamclient64.dll
EntryPointNotFound.png

Unreal keeps crashing on me and idk if it’s because I need to do something different in 4.16.

I have a uobject that i constantly GetDefaultObject from and call functions on it. The point was to make blueprint children and override it’s functions so I wouldn’t need to make instances everytime. Calling a function froma c++ child works as intended but calling a function from a bp one crashes the engine.

So does anyone know if the syntax changed from 4.15 to 4.16? Because it worked perfectly before.

I’m having a big problem with packaging in 4.16; the packaging process stucks on this line:


UATHelper: Packaging (Windows (64-bit)): Cook: Execution of commandlet took:  88.30 seconds

it seems to be all ok, but after one hour it does not finish… I tried many times, tried also to uninstall and reinstall the whole engine; restarted the pc; verified the engine… Nothing…
It worked (and works) with 4.15 and get stucked with 4.16…

Hi,
I’m having problem with UTextureRenderTarget2D since 4.16.
On 4.15 I was accessing pixels values using


 FTextureRenderTarget2DResource * textureResourceR = (FTextureRenderTarget2DResource *) RenderTargetRight->Resource;
 TArray<FFloat16Color> ColBufferFloatR;
 textureResourceR->ReadFloat16Pixels( ColBufferFloatR );

and then


value = ColBufferFloatR*.R;

Since the release of 4.16, both the access to Resource and the ReadFloat16Pixels are giving me compilation errors. Does somebody knows why ?

Secondary question as I use UnrealEngine to compile my C++ code (none of my IDE on Ubuntu succeeds on building the code), where can I see the compiler output ? The “show message log” button only gives me “Error: Failed to produce item: /home/…].so” but I cannot see where to find the detailed compiler output. (sorry for the noob question)

Thanks

This seems like a really ugly change, but if you’re defining properties or net serializers etc. for custom USTRUCTS, the TStructOpsTypeTraitsBase class has changed.

For example, this:



template<>
struct TStructOpsTypeTraits<FOrbSecondaryTickFunction> : public TStructOpsTypeTraitsBase
{
	enum
	{
		WithCopy = false
	};
};


Becomes this:



template<>
struct TStructOpsTypeTraits<FOrbSecondaryTickFunction> : public TStructOpsTypeTraitsBase2<FOrbSecondaryTickFunction>
{
	enum
	{
		WithCopy = false
	};
};


Additionally, some network properties have now been moved into a single struct type. This:



		const UWorld* MyWorld = GetWorld();
		if (MyWorld && MyWorld->GetTimeSeconds() <= GetOwner()->NetUpdateTime)
		{
			UNetDriver* NetDriver = MyWorld->GetNetDriver();
			if (NetDriver && NetDriver->IsServer())
			{
				FNetworkObjectInfo* NetActor = NetDriver->GetNetworkActor(GetOwner());
				if (NetActor && NetDriver->IsNetworkActorUpdateFrequencyThrottled(*NetActor) && ShouldCancelAdaptiveReplication())
				{
					NetDriver->CancelAdaptiveReplication(*NetActor);
				}
			}
		}


Becomes this:



		const UWorld* MyWorld = GetWorld();
		if (MyWorld && MyWorld->GetTimeSeconds() <= GetOwner()->GetNetworkObjectInfo()->NextUpdateTime)
		{
			UNetDriver* NetDriver = MyWorld->GetNetDriver();
			if (NetDriver && NetDriver->IsServer())
			{
				FNetworkObjectInfo* NetActor = NetDriver->GetNetworkObjectInfo(GetOwner());
				if (NetActor && NetDriver->IsNetworkActorUpdateFrequencyThrottled(*NetActor) && ShouldCancelAdaptiveReplication())
				{
					NetDriver->CancelAdaptiveReplication(*NetActor);
				}
			}
		}


You’ll also need to add this include to the .cpp file:

#include "Engine/NetworkObjectList.h"

If u have exception “identifier “FDrawingPolicyRenderState” is undefined”, try Rebuild your project. If it is doesn’t help u, comment out the lines like these from file MyProject.build.cs if u have them and try again:

// MinFilesUsingPrecompiledHeaderOverride = 1;
// bFasterWithoutUnity = true;

PS Maybe someone will help only “Generate Visual Studio project files” also without these lines. (Right click on MyProject.uproject file)

UPD Unfortunately it once eliminates this error. With subsequent compilation, the error will be returned =(


[2017.06.03-17.18.12:489]  0]LogProperty:Warning: Serialized Class /Script/CoreUObject.LinkerPlaceholderExportObject for a property of WidgetBlueprintGeneratedClass /Game/Blueprints/HUD/EquipmentSlot.EquipmentSlot_C. Reference will be NULLed.
    Property = ObjectProperty /Game/Blueprints/HUD/EquipmentMenu.EquipmentMenu_C:RightHandEquipmentSlot
    Item = LinkerPlaceholderExportObject /Game/Blueprints/HUD/InventoryHUD.PLACEHOLDER-INST_of_PLACEHOLDER-CLASS__EquipmentSlot_C_10

Anyone getting anything like this? It’s a pretty big issue for me, I get like tons of these on Dedicated servers, and the client just can’t open or close their UI stuff.

I checked the client logs and its the same ****, get like 100s of these things, but they are only for UI stuff.

Thank you, you’re a godsend!

This was kinda a bit user unfriendly from Epic. Not every c++ project user is actually a c++ programmer… I had no idea what those bug notes were telling me to do without you showing me.
Some of us are blueprint users venturing into c++ for some specific fixes etc! Fortunately the forum comes through :slight_smile:

I had the same problem. I moved it from the build.cs to target.cs.



public class test416Target : TargetRules
{
	public test416Target(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;

                UEBuildConfiguration.bForceEnableExceptions = true;

                 ExtraModuleNames.AddRange( new string] { "test416" } );
	}
}


Dear Community,

You’re welcome!

I would like to thank everyone in this thread for helping out.

Yay for UE4!

Have fun making Magic!

:heart:

Rama

Thanks Rama! This thread saved meh.

Unreal 4.16.1 debug game build error: ICU data directory was not discovered.

It happends on limited machines including mine.

another change

And if I replace PostLoadMap with PostLoadMapWithWorld a new error will appear.

how can I fix it?

I am trying to upgrade our project to 4.16.1 as well and run into problems with WidgetInteractionComponent which we rely on to enable users to click on 3d widgets in the world. Basically, non of them appear to work anymore. The problem seems to be known ( Widget Interaction Component broken in 4.16? - XR Development - Epic Developer Community Forums ) but I wanted to ask around if anybody had the same issues.

My investigation into the reason so far is that the line trace this component does (with channel Visibility) does not hit anything anymore.

The error message is pretty clear, it tells you PostLoadMapWithWorld has a UWorld* parameter and you’re trying to use it without one.

Try setting your widgets to use “Force Slow Construction Method” in class settings of your BP.

Getting “plugin was designed for a different version of engine. Attempt to load it anyway?” - didn’t had this issue in previous versions. This is after I’ve already made changes to build.cs and changed version in .uplugin file.
I can open project but can’t package it, every component/actor that uses plugin gets errors similar to this:


UATHelper: Packaging (Windows (64-bit)): Cook: LogLinker:Warning: CreateExport: Failed to load Parent for BlueprintGeneratedClass /Game/BluePrints/SimpleExamples/ModularDriveTrainV2.ModularDriveTrainV2_C
UATHelper: Packaging (Windows (64-bit)): Cook: LogLinker:Warning: Can't find file '/Script/MMT'

and



UATHelper: Packaging (Windows (64-bit)): Cook: LogInit:Display: LogBlueprint:Error: [Compiler ShapeAndSpring] Error Could not find a function named "MMTSetTransformComponent" in 'ShapeAndSpring'.
UATHelper: Packaging (Windows (64-bit)): Cook: Make sure 'ShapeAndSpring' has been compiled for  MMTSet Transform Component from Source: /Game/BluePrints/ReUsableComponents/SpringsAndSuspension/ShapeAndSpring.ShapeAndSpring

Indicated functions are from plugin, so it seams that this is connected to a warning “plugin was designed for a different version” at the start.

Any ideas in which directions I should be looking?

custom Editor module fails to load

In my 4.15 Project I extended the Editor Module to implement custom Component Visualizers. After upgrading to 4.16 I managed to build my project with no errors and warninngs, however when I try to load my Project, i get the error "The following modules are missing or built with a different engine version: UE4Editor-MyProjectEditor.dll . Building from the messagebox fails: “try to rebuild manually” (which i just did :slight_smile: )
I can run 4.16 as long as i remove the code block from my .uproject file which enables the custom Editor module, and i also need to remove the “Source/MyProjectEditor” subfolder. Where can i find information about what needs to be changed to get it all working again? The new Project Templates don’t help in this case… any help is highly appreciated!