How to resolve "C2660 'SWidget::Construct': function does not take 1 arguments" ?

#How to resolve C2660 ‘SWidget::Construct’: function does not take 1 arguments?

##Error message:

C2660 ‘SWidget::Construct’: function does not take 1 arguments
C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\SlateCore\Public\Widgets\DeclarativeSyntaxSupport.h 862

##Header file:

#include "SlateBasics.h"
#include "SlateExtras.h"

class SPanelWidget : public SCompoundWidget
{
public:

	SLATE_BEGIN_ARGS(SPanelWidget) {}
	SLATE_ARGUMENT(TWeakObjectPtr<class AControlPanel>, OwningPanel)
	SLATE_END_ARGS()

	void construct(const FArguments& InArgs);

	TWeakObjectPtr<class AControlPanel> OwningPanel;

	virtual bool SupportsKeyboardFocus() const override {return true;};

};

C++ file:

#include "SPanelWidget.h"

#define LOCTEXT_NAMESPACE "Panel"

void SPanelWidget::construct(const FArguments& InArgs) {
	const FText TitleText = LOCTEXT("ProjectTitle","Chair Table Practice Problem");
	const FMargin ContentPadding = FMargin(500.f,300.f);
	ChildSlot [
		SNew(SOverlay)
			+ SOverlay::Slot()
			.HAlign(HAlign_Fill)
			.VAlign(VAlign_Fill) [
				SNew(SImage)
					.ColorAndOpacity(FColor::Black)
			]
			+ SOverlay::Slot()
			.HAlign(HAlign_Fill)
			.VAlign(VAlign_Fill)
			.Padding(ContentPadding) [
				SNew(SVerticalBox)
					+SVerticalBox::Slot() [
						SNew(STextBlock)
							.Text(TitleText)
					]
			]
	];
}

#undef LOCTEXT_NAMESPACE

Kindly, help me out.

You need to declare your Construct function with an upper case ‘C’.

1 Like