I am trying to make combobox but I get this error.
linker command failed with exit code 1 (use -v to see invocation)
I honestly have no idea why.
Here are my modules being used in Plugin
"Core",
"CoreUObject",
"Engine",
"UnrealEd",
"DeveloperSettings",
"AssetTools",
"Slate",
"SlateCore",
"UMG",
"GraphEditor",
"PropertyEditor",
"EditorStyle",
"Kismet",
"KismetWidgets",
"ApplicationCore",
"ToolMenus",
"StatusBar",
Here is header file code
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "FluidNarratorEditor.h"
#include "FluidNarratorRuntime.h"
#include "CoreMinimal.h"
#include "Components/Widget.h"
#include "Widgets/Layout/SScrollBox.h"
#include "Widgets/Input/SComboBox.h"
#include "Widgets/Views/SListView.h"
#include "Widgets/Text/STextBlock.h"
#include "Widgets/Input/SButton.h"
#include "Widgets/SCanvas.h"
/**
*
*/
class UFluidNarratorDeveloperSettings;
class FluidNarratorScreenplayEditor;
class FLUIDNARRATOREDITOR_API SFluidNarratorLocalizationDashboardSlateWidget : public SCompoundWidget
{
//Construct
public:
SLATE_BEGIN_ARGS(SFluidNarratorLocalizationDashboardSlateWidget) { }
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
//Main
public:
TSharedRef<SWidget> HandelNamespaceComboBoxMakeWidget(TSharedPtr<FString> InOption) const;
void HandelNamespaceComboBoxSelectionChanged(TSharedPtr<FString> NewValue, ESelectInfo::Type);
FText HandelNamespaceComboBoxCurrentItemLabel() const;
TArray<TSharedPtr<FString>> NamespaceComboBoxOptions;
TSharedPtr<FString> NamespaceComboBoxOptionSelected;
};
Here is CPP
#include "FluidNarratorLocalizationDashboardSlateWidget.h"
#include "SlateOptMacros.h"
/*=============================================================================
Fluid Narrator Localization Dashboard Widget : Construct
=============================================================================*/
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SFluidNarratorLocalizationDashboardSlateWidget::Construct(const FArguments& InArgs)
{
UFluidNarratorDeveloperSettings* MarshallerSyntaxDeveloperSettings = GetMutableDefault<UFluidNarratorDeveloperSettings>();
//Set Padding
ChildSlot.SetPadding(FMargin(10,10));
//Vertical Box
auto VerticalBox = SNew(SVerticalBox);
ChildSlot.AttachWidget(VerticalBox);
NamespaceComboBoxOptions.Add(MakeShareable(new FString("Option1")));
NamespaceComboBoxOptions.Add(MakeShareable(new FString("Option2")));
NamespaceComboBoxOptions.Add(MakeShareable(new FString("LastOption")));
NamespaceComboBoxOptionSelected = NamespaceComboBoxOptions[0];
auto NamespaceComboBox = SNew(SComboBox<TSharedPtr<FString>>)
.OptionsSource(&NamespaceComboBoxOptions)
.OnSelectionChanged(this, &SFluidNarratorLocalizationDashboardSlateWidget::HandelNamespaceComboBoxSelectionChanged)
.OnGenerateWidget(this, &SFluidNarratorLocalizationDashboardSlateWidget::HandelNamespaceComboBoxMakeWidget)
.InitiallySelectedItem(NamespaceComboBoxOptionSelected)
[
SNew(STextBlock)
.Text(this, &SFluidNarratorLocalizationDashboardSlateWidget::HandelNamespaceComboBoxCurrentItemLabel)
];
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
/*=============================================================================
Fluid Narrator Localization Dashboard Widget : Main
=============================================================================*/
TSharedRef<SWidget> SFluidNarratorLocalizationDashboardSlateWidget::HandelNamespaceComboBoxMakeWidget(TSharedPtr<FString> InOption) const
{
return SNew(STextBlock).Text(FText::FromString(*InOption));
}
void SFluidNarratorLocalizationDashboardSlateWidget::HandelNamespaceComboBoxSelectionChanged(TSharedPtr<FString> NewValue, ESelectInfo::Type)
{
NamespaceComboBoxOptionSelected = NewValue;
}
FText SFluidNarratorLocalizationDashboardSlateWidget::HandelNamespaceComboBoxCurrentItemLabel() const
{
if (NamespaceComboBoxOptionSelected.IsValid())
{
return FText::FromString(*NamespaceComboBoxOptionSelected);
}
return FText::FromString("NULL");
}