FCanvas::GetSortElement does not export

FCanvas::GetSortElement does not export

Cause linking unresolved symbol error.

Hello,

Could you clarify exactly what sort of error you are experiencing? If possible, could you post a screenshot of where you are seeing this error appear?

C++ linking error.
Unresovled symbol FCanvas::GetSortElement…

  • How are you using GetSortElement in your code?
  • Where are you calling it from?
  • What exactly do you mean when you say it “does not export”
  • If possible, could you provide section of code where you are seeing error?

I’m not all that familiar with FCanvas::GetSortElement. How are you intending to use it?

ENGINE_API FCanvasSortElement& GetSortElement(int32 DepthSortKey);

This will solve linking problem in Editor Build of Game.
You don’t need to understand.

Linking Error messages:

: error LNK2019: unresolved external
symbol “public: class
FCanvas::FCanvasSortElement & __cdecl
FCanvas::GetSortElement(int)”
(?GetSortElement@FCanvas@@QEAAAEAVFCanvasSortElement@1@H@Z)
referenced in function “public:
virtual void __cdecl
FMeshCanvasItem::Draw(class FCanvas
*)” (?Draw@FMeshCanvasItem@@UEAAXPEAVFCanvas@@@Z)

Codes:

void FMeshCanvasItem::Draw(FCanvas* InCanvas)
{
	if (Meshes.Num())
	{
		// get sort element based on  current sort key from top of sort key stack
		//FCanvas::FCanvasSortElement& SortElement = GetSortElement(InCanvas, InCanvas->TopDepthSortKey());
		FCanvas::FCanvasSortElement& SortElement = InCanvas->GetSortElement(InCanvas->TopDepthSortKey());
		// find a batch to use 
		FMeshCanvasRenderItem* RenderBatch = nullptr;
		// get  current transform entry from top of transform stack
		const FCanvas::FTransformEntry& TopTransformEntry = InCanvas->GetTransformStack().Top();

		// try to use  current top entry in  render batch array
		if (SortElement.RenderBatchArray.Num() > 0)
		{
			checkSlow(SortElement.RenderBatchArray.Last());
			RenderBatch = dynamic_cast<FMeshCanvasRenderItem*>(SortElement.RenderBatchArray.Last());
		}
		// if a matching entry for this batch doesn't exist then allocate a new entry
		if (RenderBatch == nullptr)
		{
			//INC_DWORD_STAT(STAT_Canvas_NumBatchesCreated);

			RenderBatch = new FMeshCanvasRenderItem();
			RenderBatch->SetCanvasItem(this);
			RenderBatch->SetLocalPlayer(LocalPlayer);
			SortElement.RenderBatchArray.Add(RenderBatch);
		}
		FHitProxyId HitProxyId = InCanvas->GetHitProxyId();
		// add  quad to  tile render batch
		//FMeshBatch MeshBatch;
		//RenderBatch->AddMesh(MeshBatch);

		RenderMesh(RenderBatch);
	}

	//Meshes.Empty();
}

Hi Henry,

When we ask for details, please give them to best of your ability. If we do not understand how to reproduce issue and you haven’t given us details we require, then no bug report can be created.

Please give us clear, detailed instructions on how to reproduce this error in a new project in a vanilla version of engine, and then we can test and, if appropriate, enter a bug report for developers to consider. Thank you.

Hi Henry,

We haven’t heard from you in a while, so I’m resolving this post for tracking purposes. If you’re able to provide information requested above, or anything else that could help us reproduce issue you’ve encountered, please feel free to respond here and we’ll continue investigating. Thanks!