No instance of constructor

Hello I having error with header file that seems to be showing error in visual studio.

The project does compile but the header itself is showing errors that is part of my editor style header

Visual Studio is showing the following error.

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	E0289	no instance of constructor "FSlateImageBrush::FSlateImageBrush" matches the argument list	UnrealPlugins	f:\Unreal Engine 4.19\UnrealPlugins\Plugins\TaskManagement\Source\TaskManagement\Private\TaskManagementEdModeStyles.cpp	41

The snippet of the code seems to be causing the error.

#define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush( RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
#define BOX_BRUSH( RelativePath, ... ) FSlateBoxBrush( RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
#define BORDER_BRUSH( RelativePath, ... ) FSlateBorderBrush( RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
#define DEFAULT_FONT(...) FCoreStyle::GetDefaultFontStyle(__VA_ARGS__)

// This line is the error
	StyleInstance->Set( "LevelEditor.TaskManagementMode", new IMAGE_BRUSH( "Icons/icon_Mode_Foliage_40x", Icon40x40 ) );
	StyleInstance->Set( "LevelEditor.TaskManagementMode.Small", new IMAGE_BRUSH( "Icons/icon_Mode_Foliage_40x", Icon20x20 ) );
	StyleInstance->Set( "LevelEditor.TaskManagementMode.Selected", new IMAGE_BRUSH( "Icons/icon_Mode_Foliage_selected_40x", Icon40x40 ) );
	StyleInstance->Set( "LevelEditor.TaskManagementMode.Selected.Small", new IMAGE_BRUSH( "Icons/icon_Mode_Foliage_selected_40x", Icon20x20 ) );

#undef IMAGE_BRUSH
#undef BOX_BRUSH
#undef BORDER_BRUSH
#undef DEFAULT_FONT

As it seems where I using the define is causing the error but not sure what to include to fix the error.

It can’t recognize the FSlateImageBrush constructor, which is part of the IMAGE_BRUSH macro. Since the macro takes variable args, the issue is mostly with Icon40x40. Have you defined this in your file? If not, define it like this in same function somewhere above

const FVector2D Icon40x40(40.0f, 40.0f);