Got confused with casting

I’ve got a conversion code, which yields no errors itself:


	FSlateApplication& application = FSlateApplication::Get();

	if (application.GetActiveModalWindow().IsValid())
	{
		TSharedPtr<SWindow> window = application.GetActiveModalWindow();
		SWindow* windowPtr = window.Get();

		if (windowPtr != nullptr)
		{

                            TSharedRef<const SWidget> content = windowPtr->GetContent();
			    const SWidget& fbxScene = content.Get();
			    SWidget& fbxSceneNC = const_cast<SWidget&>(fbxScene);
			    SFbxSceneOptionWindow& sceneOptionWindow = (SFbxSceneOptionWindow&)(fbxSceneNC);

				FString MaterialBasePath = "/Game/Worldmap/Materials/";
				FText inText = FText::FromString(MaterialBasePath);

				sceneOptionWindow.OnMaterialBasePathCommited(inText, ETextCommit::Type::Default);
				sceneOptionWindow.OnImport();
                }
           }

But, if those 2 lines are included:


				sceneOptionWindow.OnMaterialBasePathCommited(inText, ETextCommit::Type::Default);
				sceneOptionWindow.OnImport();

I oddly get linker error:

Where does this linker error comes from?