If a TextureRenderTarget2D is used in a code class, the build of the project will fail with an error stating that the UTextureRenderTarget base class is undefined. The line #include "Engine/TextureRenderTarget.h" needs to be added to TextureRenderTarget2D.h in order to build the project.
virtual void DrawHUD() override; UTextureRenderTarget2D* MiniMapTex;
#include "CanvasItem.h"
void AMyHUD::DrawHUD()
{
Super::DrawHUD();
FVector2D MiniMapDrawPosition(0, 0);
FCanvasTileItem MiniMapTileItem(MiniMapDrawPosition, MiniMapTex->Resource, FLinearColor::White);
}
RESULTS:
The build fails with the following error:
1>D:\Main-Builds\UE4\Engine\Source\Runtime\Engine\Classes\Engine/TextureRenderTarget2D.h(17): error C2504: 'UTextureRenderTarget' : base class undefined
EXPECTED:
The build completes successfully.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Foundation - Core |
---|---|
Target Fix | 4.6 |
Created | Nov 5, 2014 |
---|---|
Resolved | Nov 12, 2014 |
Updated | Feb 5, 2017 |