Third party header causing build error with UCanvasRenderTarget

I’m trying to use a third party library (OpenNURBS) in a Blueprint Function Library plugin. I have successfully used this library directly in a project before with 4.18, but am moving to 4.19 and decided to migrate the functionality to a plugin.

But when I include the third party header file into my code, I suddenly get the following compile errors about UCanvasRenderTarget2D::UpdateResourceW and UTextureCube::UpdateResourceW:

Error C3668	'UCanvasRenderTarget2D::UpdateResourceW': method with override specifier 'override' did not override any base class methodsC:\Program Files\Epic Games\UE_4.19\Engine\Source\Runtime\Engine\Classes\Engine/CanvasRenderTarget2D.h(43): error C3668: 'UCanvasRenderTarget2D::UpdateResourceW': method with override specifier 'override' did not override any base class methods

Error C3668	'UTextureCube::UpdateResourceW': method with override specifier 'override' did not override any base class methodsC:\Program Files\Epic Games\UE_4.19\Engine\Source\Runtime\Engine\Classes\Engine/TextureCube.h(69): error C3668: 'UTextureCube::UpdateResourceW': method with override specifier 'override' did not override any base class methods

The other issue that comes up when including the header is a warning about TEST macro redefinition in winnt.h

Warning C4005	'TEXT': macro redefinition C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h

I know it’s hard to solve problems without knowing the exact details of the third party code, but given the seemingly randomness of the texture and canvas render problem, combined with the fact that I have used the library without issue in other projects makes me thoroughly confused.

Any thoughts??? Thanks!

I resolved the same issue by including following headers in YourProject.h

#include "CoreMinimal.h"
#include "Runtime/UMG/Public/UMG.h"
#include "Runtime/UMG/Public/UMGStyle.h"
#include "Runtime/UMG/Public/Slate/SObjectWidget.h"
#include "Runtime/UMG/Public/IUMGModule.h"
#include "Runtime/UMG/Public/Blueprint/UserWidget.h"

It cost me 3 days to figure it out : (

I was getting this exact same issue, however those includes did not do anything for me.

I found this link below and it did solve issue I was having. The problem was my 3rd party plugin was referencing some misc windows specific headers when I included them in my plugin.

#include "AllowWindowsPlatformTypes.h"

//The external headers and defines goes here

#include "HideWindowsPlatformTypes.h"

Lots more info in this post:
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1361551-editor-won-t-build-if-a-source-file-is-modified-and-the-unmodified

I solved the same problem by removing the #include of my project.

I solved the same problem by removing the #include <windows.h> of my project.