C++ 4.16 Transition Guide

@BoredEngineer I thought that message was always down to the engine version in the .uplugin file. Have you set it to “4.16.0”? Assuming it’s working in editor, it seems like it can’t/isn’t trying to load your plugin module in non-editor build. Do you have an entry for the plugin in the .uproject file, and an entry for the module (with type=Runtime) in the .uplugin?

@ponxalot It looks like it’s not rebuilding the module for some reason. I’d first try a full clean and rebuild. If that doesn’t help, you may be missing an entry for the module in your .uproject, or perhaps it needs adding to the ExtraModuleNames array in the .Target.cs file.

My apologies, forgot to reply here. So the issue was indeed in specifying version of the Engine as 4.16.1 and it should be 4.16.0. This is somewhat new I think as 4.15 compatible version of plugin had 4.14.3 written in .uplugin as engine version.

And what about for plugins? I’m not aware of a plugin having a target.cs file. I couldn’t find any examples of one either.

Changed from 4.14 to 4.16. I do not know what the error is.
Looking at the guide, I changed three file codes related to Target and Bulid.
I compiled it and it did not have any problems.
An error occurs when running the engine.
I do not know why. Please help me.

4.PNG6.PNG

Looks like you are running it from Visual Studio, right? Switch Startup Project from UE4 to <YourGameProject>

Editor Module is no longer building correctly in 4.16

Thanks , my Editor Module is starting to build again! However when i add it to my .uproject, i get compile errors in my MyPrioject.h, complaining about “unexpected token ‘struct’” (see screenshot below).

The affected header files build fine when i remove my Editor Module from the .uproject.
If i remove the DECLARE_LOG_CATEGORY_EXTERN , the next error pops up in my first UENUM(BlueprintType), complaining about "unexpected token ‘enum class’.

It looks líke basic engine features / macros are not being linked in correctly. :confused: I’m lost here… any ideas?

Are they definitely build errors, and not just intellisense errors that you can (and should) ignore?

If so, I’d guess the error is elsewhere, maybe in another header that’s included before this one?

Add the following includes:



#include "Logging/LogCategory.h"
#include "Logging/LogMacros.h"


Thanks , thanks ExtraLifeMatt! It’s working, hooray! :smiley: There was one header file of mine missing a semicolon at it’s end… X-/ Many thanks for your help!

You may no longer access the input component anymore in 4.16 easily. Client - Microsoft Visual Studio  6_16_2017 1_11_52 PM.png

Anyone is able to compile Shipping Game on Win32 with 4.16 here?

I have some custom UWidget classes that wrap Slate text/“noborder” buttons. They were displaying fine in 4.15, but in 4.16 the text is only showing up as faint irregular dots, and the engine crashes after a few seconds of displaying them.


Access violation - code c0000005 (first/second chance not available)

UE4Editor_SlateRHIRenderer!FSlateRHIResourceManager::GetShaderResource() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slaterhirenderer\private\slaterhiresourcemanager.cpp:524]
UE4Editor_SlateCore!FSlateDrawElement::MakeBox() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slatecore\private\rendering\drawelements.cpp:143]
UE4Editor_Slate!SButton::OnPaint() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slate\private\widgets\input\sbutton.cpp:85]
UE4Editor_SlateCore!SWidget::Paint() [d:\build\++ue4+release-4.16+compile\sync\engine\source\runtime\slatecore\private\widgets\swidget.cpp:776]

Did something change with Slate widget rendering?

Edit: False alarm on the crash, poked around more and got it to reproduce on 4.15. The display issue is still 4.16-only, though.

For me using


bEnableExceptions = true;

instead seems to work.

We have code that uses/used the AssetToolsModule but this code no longer compiles.



FAssetToolsModule& assetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>("AssetTools");
assetToolsModule.Get().ImportAssets(...);




error C2027: Use of undefined type 'IAssetTools'
error C2228: left of '.ImportAssets' must have class/struct/union


This is an example, but we are making heavy use of this module for our own custom importers, so this similar error is popping up all over. Basically it looks like the module is undefined everywhere.

They just separated out the interface header from the module header, so you need to now also include “IAssetTools.h”.

When ever you create a character and have the game set up default to the character, 4.16 no longer spawns and auto possess the character for you. Is this a bug or change?

Some pictures in case anyone is having the same issue. Fresh clone from 4.15 -> 4.16, my UWidget wrapping a Slate SBox/Sbutton/STextBlock is rendering as faint white dots.

e86d5462aa17a5f82e7a2c3da6e9f08baf1c9cf4.jpeg 4.16.JPG
4.15 on left, 4.16 on right

I can’t seem to find that in C++. Does that translate to anything I can set in code?

I was using an FInternationalization. But it seems to no longer work in 4.16. I get the following error.

Tt did work fine in 4.14-15.

.cpp



#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "Getlanguage.generated.h"

/**
 * 
 */
UCLASS()
class TGAME_API UGetlanguage : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	/* Get Current Localization at Runtime. */
	UFUNCTION(BlueprintPure, meta = (DisplayName = "GetActiveLanguage", CompactNodeTitle = "ActiveLanguage", Keywords = "GetActiveLanguage"), Category = "Localization")
	static FString GetActiveLanguage();
	
};


.h



#include "Getlanguage.h"
#include "Tgame.h"


FString UGetlanguage::GetActiveLanguage()
{
	return FInternationalization::Get().GetCurrentCulture()->GetName();
}


Can anyone help.

Seems like you’re just missing some includes. Find where FCulture is declared and add it.